Mass Reverse-DNS Lookup

September 4th, 2008 by Xerxes Leave a reply »

I needed to quickly browse through some web-server logs and pull out the hostnames which were accessing the web-server (to see where people were originating from).

The following single linux command will pull the IP address out of the apache log (for a particular date) and do the reverse DNS lookup for me:

cat access.log | grep ’1/Sep’ | awk ‘{print $1}’ | sort | uniq | xargs -n1 host | grep -v ‘not found’

just in case i ever need it again….

Be Sociable, Share!

Related posts:

  1. Making Resolving Conflicts in Git Easier One thing that bugs me when using Git, is that...
  2. Mounting NAS drive under Ubuntu I’ve been battling this one for a long time….Finally got...
  3. Instant Twitter Bookmark Tonight’s been a busy night for silly coding This first...
  4. Finding out what’s process is listening on port 80 Just saw an excellent tweet by @chadmyers: FYI, to find...
  5. Scripting Google Chrome for OSX using AppleScript When it comes to software tools, i like to spend...

1 comment

  1. Interesting query. I am definately going to have to play around with that command.