in reply to OO, Net::DNS host lookup, multiple nameservers

You are very close. To query each nameserver once, put your nameservers in a list and iterate through the list, assigning each nameserver once to a resolver and querying it. See the following:
use Net::DNS; use strict; my @nameservers=("192.168.1.1", "192.168.2.2", "192.168.3.3"); my $nameserver; foreach $nameserver(@nameservers){ print "checking on $nameserver\n"; my $res = new Net::DNS::Resolver; $res->nameservers($nameserver); my $query = $res->search("www.perlmonks.com"); if ($query) { my $rr; foreach $rr ($query->answer) { next unless $rr->type eq "A"; print $rr->address, "\n"; } }else { print "query failed: ", $res->errorstring, "\n"; } }
If you assign multiple nameservers to one resolver, it will use them as alternate nameservers in case it doesn't hear back from one of the others.