how can i issue a nmap command that shows me all the alive machines' IP s and corresponding hostname s in the LAN that i am connected? (if this can be done in another way/tool you're welcomed to answer surely)
|
feedback
|
migrated from stackoverflow.com Jun 22 '10 at 20:22
This question came from our site for professional and enthusiast programmers.
This gives me hostnames along with IP adresses, and only pings the hosts to discover them | |||||||
feedback
|
|
You can scan an entire subnet, can use wildcards also.
or
| |||
|
feedback
|
|
NMAP will return the 'reverse-lookup' of the IP address in question, it can't return the forward lookup address. Or addresses in the case of Web Servers doing name-based virtual hosting. Nmap isn't the tool for this. | |||||
|
feedback
|
|
nmap -sP 192.168.0.0/24 will output something like :
| |||||
feedback
|
Note that name resolution is only as good as the reverse-dns population is. Also note that this won't get you systems which are firewalled against ping (which practically every windows workstation is by default). If you are local to the systems (ie on the same subnet) you can do something like
...but weird things happen to me sometimes when I wrap arping up in a loop. Also you have to do the lookup yourself, with something like
| |||
|
feedback
|
|
I think you should run this:
| ||||
|
feedback
|