in reply to Re^6: Net::DNS::Resolver v0.61 output
in thread Net::DNS::Resolver v0.61 output

The same server ?

Krambambuli
---
enjoying Mark Jason Dominus' Higher-Order Perl

Replies are listed 'Best First'.
Re^8: Net::DNS::Resolver v0.61 output
by mikejones (Scribe) on Oct 24, 2007 at 22:28 UTC
    yes the same server as the script is running is where nslookup succeeds.
      This seem weird. What if you instruct nslookup to

      > norecurse

      ? I suspect that the difference between nslookup's behavior and your script is that nslookup is much more 'determined to return a result', and follows the initial hint to follow up going to the authoritative servers.

      Also, try to turn on recursion in Net::DNS::Resolver with
      my $res = Net::DNS::Resolver->new( nameservers => [qw(nnnnn.com xxxxx.com)], recurse => 1, debug => 1, );
      Another question that might be useful: do you see a different behavior when asking the specific nameservers about some hostname for which they are authoritative ?

      You might want to play a bit with the nslookup/script pair for checking some other nameservers, that are outside your internal network. That should give you a clue about what to expect.

      Hth.

      Krambambuli
      ---
      enjoying Mark Jason Dominus' Higher-Order Perl
        I did not see any differences when asking for the specific nameserver about some hostame. However, I was able to fix this problem. Having the debug and recurse options on did not point me in the right direction b/c I did not see the method ptrdname in the debug output.

        FIX WAS: I needed to change address method to ptrdname method. I found this using dumper on the $rr variable. Thank you for your persistence and help! :)

        my $res = Net::DNS::Resolver->new( nameservers => [qw(ns7.xx.com xx.xx.xx.com)], recurse => 0, ## dont do recursive lookups debug => 0, ); my $query = $res->search("10.xx.xx.55"); use Data::Dumper; #print Dumper($query); #exit; if ($query) { foreach my $rr ($query->answer) { next unless $rr->type eq "PTR"; ## skip record if not eq PTR + ## print $rr->ptrdname, "\n"; print Dumper($rr); } } else { warn "query failed: ", $res->errorstring, "\n"; } #for my $key (keys %ns7IP) { # print $key,' => ',join "\n\t", sort @{$ns7IP{$key}},"\n"; #} print "\n"; "DNS_results.plx" 71 lines, 2813 characters

        root@xxxxx(R3 Prod):/home/ # perl DNS_results.plx sap005.alxxxmeX.com

        $VAR1 = bless( { 'rdlength' => 22, 'ttl' => 2195, 'name' => '55.xx.xx.10.in-addr.arpa', 'ptrdname' => 'sap005.alxxxsmeX.com', 'class' => 'IN', 'type' => 'PTR', 'rdata' => 'sap005 alarixxxxx' }, 'Net::DNS::RR::PTR' );