develooper Front page | perl.beginners | Postings from March 2002

DNS lookup

Thread Next
March 18, 2002 13:19
DNS lookup
Message ID:
I need to find a way to do a DNS lookup of a list of ips (at least 250
entries), get their corresponding hostnames and produce a report.

It sounds very simple, an I implemented it with "nslookup ip" (loop for 250
I tried "host -al" (which produces a long list of host, so that with PERL
one can do a match).  The problem with this is that the output did not
contain any of the entries in the of ips I was looking for.

Can someone please come to my aid?

So say I have a file:

IP                 Some title      Some title
------------------------------------------------       lkdklkdk         dklkdlkd        dkjdjd            dolkldk


I need to produce something like this:

IP                  Hostname       Some title     Some title
-----------------------------------------------------------           tiger         lkdklkdk        dklkdlkd            lion          dkjdjd          dolkldk

With my current (using nslookup) takes a some time for a long list of ips.


William Ampeh (x3939)
Federal Reserve Board

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About