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

DNS lookup

Thread Next
From:
William.Ampeh
Date:
March 18, 2002 13:19
Subject:
DNS lookup
Message ID:
OF52C05748.8F00AE36-ON85256B80.0074FF46@frb.gov
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
times).
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
------------------------------------------------
190.10.0.1       lkdklkdk         dklkdlkd
190.0.2.3        dkjdjd            dolkldk

------------------------------------------------

I need to produce something like this:

IP                  Hostname       Some title     Some title
-----------------------------------------------------------
190.10.0.1           tiger         lkdklkdk        dklkdlkd
190.0.2.3            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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About