Ubuntu – How to find a computer name in a LAN from the IP address

hostname

My network includes machines running Linux and others running Windows. And my machine is running Linux.

Best Answer

Type in terminal.

sudo nmap -sn <Your LAN Subnet>

For Example:

sudo nmap -sn 192.168.1.*

You can find your LAN subnet using ip addr command.

It will show all host name in LAN whether it is Linux or Windows. You also able to see mobile devices, if any present on LAN network. Here you need to make sure that you run command with sudo or root.

Related Question