nmap -sL 74.125.237.1/24

Find resolvable hosts in subnet

Nmap will list all IP's in the target specified, can specify subnet or range of IP addresses. It will attempt to resolve all IP's listed. No packets sent to target only generates DNS queries.
Sample Output
Starting Nmap 5.61TEST5 ( http://nmap.org ) at 2012-05-30 10:47 EST
Nmap scan report for syd01s04-in-f0.1e100.net (74.125.237.0)
Nmap scan report for syd01s04-in-f1.1e100.net (74.125.237.1)
Nmap scan report for syd01s04-in-f2.1e100.net (74.125.237.2)
Nmap scan report for syd01s04-in-f3.1e100.net (74.125.237.3)
Nmap scan report for syd01s04-in-f4.1e100.net (74.125.237.4)

0
2012-05-30 00:51:20

These Might Interest You

  • The command will make it easy to determine free IP ranges in a crowded sub-net. Show Sample Output


    0
    SUBNET="192.168.41" ; diff -y <(nmap -sP -n ${SUBNET}.0/24 | grep ${SUBNET}. | awk '{print $5}' | sort -t"." -k4 -n) <(for i in $(seq 1 254); do echo ${SUBNET}.$i; done)
    michel_p · 2012-08-28 09:11:18 0

  • 0
    nmap -sP <subnet>.* | egrep -o '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' > results.txt ; for IP in {1..254} ; do echo "<subnet>.${IP}" ; done >> results.txt ; cat results.txt | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | uniq -u
    bortoelnino · 2010-01-22 00:26:42 1
  • Will append lines to the hosts file to do some basic ad blocking.


    2
    sudo mount -o remount,rw / && sudo cp /etc/hosts /etc/hosts.old && wget http://winhelp2002.mvps.org/hosts.txt && cp /etc/hosts ~/ && cat hosts.txt >> hosts && sudo cp hosts /etc/hosts
    bugmenot · 2016-06-06 15:01:19 1
  • Somewhat shorter version. Show Sample Output


    4
    fping -r1 -g <subnet> 2> /dev/null | grep unreachable | cut -f1 -d' '
    unixmonkey7953 · 2010-01-22 09:07:04 0

  • 0
    for ip in `seq 1 255`; do ping -c 1 192.168.1.$ip ; done | grep ttl
    takeshin · 2010-06-05 13:15:06 1
  • documents all active ips on a subnet and saves to txt file. Show Sample Output


    -9
    FOR /L %i IN (1,1,254) DO ping -n 1 10.254.254.%i | FIND /i "Reply">> c:\ipaddresses.txt
    barrytrujillo · 2010-06-29 21:02:21 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: