network

How to find alive hosts in our network

Sometimes I need to know all the alive hosts’ IP addresses in the LAN I am connected. The following command will show that information:

$ nmap -n -sP 192.168.10.0/24

Starting Nmap 5.21 ( http://nmap.org ) at 2012-08-05 11:24 BST
Nmap scan report for 192.168.10.1
Host is up (0.00086s latency).
Nmap scan report for 192.168.10.40
Host is up (0.00057s latency).
Nmap scan report for 192.168.10.50
Host is up (0.00056s latency).
Nmap scan report for 192.168.10.100
Host is up (0.00051s latency).
Nmap done: 256 IP addresses (4 hosts up) scanned in 13.44 seconds

The option -sP tells nmap to do a ping scan, that is, to go no further than determining if host is online.
The option -n will never do DNS resolution. If the hostname is needed then do not use the -n option or use instead the option -R (always resolve).

speak up

Add your comment below, or trackback from your own site.

Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*Required Fields