using nmap to get a list of DNS host names

Sometimes you want to update your hosts file, but you don't remember what all your hostnames are, or some have been added that didn't follow whatever process you've got in place, so are unlisted.

This little deal will list all the host names for a particular range (in this example, 192.168.1.0 through 192.168.1.255):

nmap -sL 192.168.1.0/24 | tr -d '()' | awk '{print $3 "\t" $2}'

You obviously need nmap, tr, and awk for this to work.

End Of Line

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
BlogCFC was created by Raymond Camden. This blog is running version 5.9.3.000. Contact Blog Owner