How can I issue a nmap command that shows me all the alive machines' IP addresses and corresponding hostname s in the LAN that I am connected?
(if this can be done in another way/tool you surely are welcome to answer)
Nmap find all alive hostnames and IPs in LAN
nmap
Best Answer
nmap versions lower than 5.30BETA1:
newer nmap versions:
This gives me hostnames along with IP adresses, and only pings the hosts to discover them. This will only give you the hostnames if you run it as
root
.EDIT: As of Nmap 5.30BETA1 [2010-03-29]
-sP
has been replaced with-sn
as the preferred way to do ping scans, while skipping port scanning, just like the comments indicate: