gnangia has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use Net::DNS; # Create DNS Resolver object my $res = Net::DNS::Resolver->new; $res->nameservers(); # Specify the name server my $nameserver = "12.104.122.2"; #Perform the query #my $query = $res->searchlist(@host); my $query = $res->search('www.chase.com'); $res->print; if ($query) { foreach my $rr ($query->answer) { next unless $rr->type eq "A"; print "host resolves to " . $rr->address . "\n"; } } else { print "query failed: ", $res->errorstring, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to do multiple dns queries ?
by pg (Canon) on Nov 23, 2002 at 03:55 UTC | |
by gnangia (Scribe) on Nov 24, 2002 at 03:23 UTC | |
|
Re: How to do multiple dns queries ?
by jaldhar (Vicar) on Nov 23, 2002 at 03:30 UTC | |
by gnangia (Scribe) on Nov 24, 2002 at 03:33 UTC | |
by jaldhar (Vicar) on Nov 25, 2002 at 05:03 UTC |