svankalken has asked for the wisdom of the Perl Monks concerning the following question:

my $res=Net::DNS::Resolver->new; $res->nameservers(xx.xx.xx.xx); my $search = $res->search($input); if ($search) { foreach $rr ( $search->answer) { my $type=$rr->type; if ($type eq "A") { $host=$rr->address; } if ($type eq "PTR") { $host=$rr->ptrdname; } print "$input\t$host\n";
.....my $res->nameserver(xx.xx.xx.xx); doesn't seem to be working.... any ideas?

forgive the fomatting - still learing the <code> stuff.

edit (broquaint): added formatting

Replies are listed 'Best First'.
Re: another net::DNS question
by Crackers2 (Parson) on Jun 28, 2004 at 04:35 UTC

    Did you remember to put quotes around that IP address? Otherwise it's going to be interpreted as a dotted version string, which is definitely not going to give the results you want.

    i.e.
    $res->nameservers("xx.xx.xx.xx");
    instead of
    $res->nameservers(xx.xx.xx.xx);