LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 09-29-2009, 01:59 PM   #1
aptget
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Rep: Reputation: 0
reverse (batch) dns lookup


Hello,

I have a long list of IPs in an ASCII text file (over 200 IPs). I would like to perform reverse dns lookup for these IPs.

Can anyone tell me if there is some sort of perl script (dig, host, nsllokup, etc) that I can run against this text file that would let me pipe the results to another file. I've searched through the forum w/ no avail.

Any help or suggestions would be greatly appreciated!

regards,
sky
 
Old 09-29-2009, 02:12 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 39,857

Rep: Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121Reputation: 1121
for i in $(cat input.txt)
do
host $i
done > output.txt
 
Old 09-29-2009, 02:30 PM   #3
aptget
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Hi,

Pardon my ignorance, when I ran this in a file didn't do anything.

Do you I need make the file executable (chmod 755)?

regards,
sky
 
Old 09-29-2009, 03:00 PM   #4
aptget
LQ Newbie
 
Registered: Sep 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Never mind, I figure out what was wrong - thanks!


regards,
sky
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
reverse DNS lookup mimithebrain Linux - Networking 6 02-10-2011 12:53 AM
Reverse dns lookup in C virtualCoder Programming 3 09-27-2009 02:24 AM
Reverse DNS lookup question schapman43 Linux - Server 1 08-21-2009 03:19 PM
Ident / Reverse DNS Lookup maq Linux - Networking 1 03-31-2005 05:59 PM
reverse DNS lookup phil1076 Linux - General 1 01-22-2002 03:24 PM


All times are GMT -5. The time now is 05:15 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration