Subject: | No redundant lookups on SERVFAIL response |
Distribution: Net-DNS-0.48 (installed from CPAN)
Perl version: This is perl, v5.8.0 built for i386-linux-thread-multi
OS: Linux mentha 2.4.25 #2 SMP Fri Apr 2 16:39:49 CEST 2004 i686 i686 i386 GNU/Linux on a RedHat 9
Dear Authors!
I see that Net::DNS::Resolver::Recursion does no full redundant lookups if the first (any) nameserver reply SERVFAIL. I check the source and I see that Net::DNS::Resolver::Base::send_udp and Net::DNS::Resolver::Base::send_tcp do the nameserver selection, and if it got any answer (ex. SERVFAIL) it passes back.
RFC 1035 on page 2 says:
"Resolvers are responsible for dealing with the distribution of
the domain space and dealing with the effects of name server failure by
consulting redundant databases in other servers."
This means to me the resolver should check the next on nameserver on a SERVFAIL response, and pass it back only if it is the reposnse of the last nameserver.
What do you think about the problem? Am I right? If not what is the workaround for the problem (not to mention to repair the failing nameserver)?
Thank you!
Best,
Aron Ujvari
Program snippet:
my ($domain) = @_;
my $packet = $resolv->query_dorecursion($domain, 'SOA');
if (!defined($packet)) {
print "x\n";
next;
}
my @answer = $packet->answer;
my @soa = map { $_->rdatastr; } grep { $_->type eq 'SOA'; } @answer;
Program output snippet:
;; Answer received from 193.0.14.129 (247 bytes)
;;
;; HEADER SECTION
;; id = 36873
;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 0
;; ra = 0 ad = 0 cd = 0 rcode = NOERROR
;; qdcount = 1 ancount = 0 nscount = 6 arcount = 6
;; QUESTION SECTION (1 record)
;; net.hu. IN SOA
;; ANSWER SECTION (0 records)
;; AUTHORITY SECTION (6 records)
hu. 172800 IN NS ns.nic.hu.
hu. 172800 IN NS ns2.nic.fr.
hu. 172800 IN NS sunic.sunet.se.
hu. 172800 IN NS ns1.nic.hu.
hu. 172800 IN NS ns2.nic.hu.
hu. 172800 IN NS ns3.nic.hu.
;; ADDITIONAL SECTION (6 records)
ns.nic.hu. 172800 IN A 193.6.27.62
ns2.nic.fr. 172800 IN A 192.93.0.4
sunic.sunet.se. 172800 IN A 192.36.125.2
ns1.nic.hu. 172800 IN A 194.38.118.51
ns2.nic.hu. 172800 IN A 193.6.16.1
ns3.nic.hu. 172800 IN A 195.70.35.250
;; _dorecursion() Response received from [193.0.14.129]
;; _dorecursion() Received authority [hu.] [NS] [ns.nic.hu.]
;; _dorecursion() FOUND closer authority for [hu.] at [ns.nic.hu.].
;; _dorecursion() Received authority [hu.] [NS] [ns2.nic.fr.]
;; _dorecursion() FOUND closer authority for [hu.] at [ns2.nic.fr.].
;; _dorecursion() Received authority [hu.] [NS] [sunic.sunet.se.]
;; _dorecursion() FOUND closer authority for [hu.] at [sunic.sunet.se.].
;; _dorecursion() Received authority [hu.] [NS] [ns1.nic.hu.]
;; _dorecursion() FOUND closer authority for [hu.] at [ns1.nic.hu.].
;; _dorecursion() Received authority [hu.] [NS] [ns2.nic.hu.]
;; _dorecursion() FOUND closer authority for [hu.] at [ns2.nic.hu.].
;; _dorecursion() Received authority [hu.] [NS] [ns3.nic.hu.]
;; _dorecursion() FOUND closer authority for [hu.] at [ns3.nic.hu.].
;; _dorecursion() STORING: ns.nic.hu. IN A 193.6.27.62
;; _dorecursion() STORING: ns2.nic.fr. IN A 192.93.0.4
;; _dorecursion() STORING: sunic.sunet.se. IN A 192.36.125.2
;; _dorecursion() STORING: ns1.nic.hu. IN A 194.38.118.51
;; _dorecursion() STORING: ns2.nic.hu. IN A 193.6.16.1
;; _dorecursion() STORING: ns3.nic.hu. IN A 195.70.35.250
;; _dorecursion() depth=[1] known_zone=[hu.]
;; _dorecursion() cutting deck of (6) authorities...
;; _dorecursion() First nameserver [193.6.16.1]
;; send_udp(193.6.16.1:53)
;; answer from 193.6.16.1:53 : 24 bytes
;; HEADER SECTION
;; id = 36873
;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 0
;; ra = 0 ad = 0 cd = 0 rcode = SERVFAIL
;; qdcount = 1 ancount = 0 nscount = 0 arcount = 0
;; QUESTION SECTION (1 record)
;; net.hu. IN SOA
;; ANSWER SECTION (0 records)
;; AUTHORITY SECTION (0 records)
;; ADDITIONAL SECTION (0 records)
;; Answer received from 193.6.16.1 (24 bytes)
;;
;; HEADER SECTION
;; id = 36873
;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 0
;; ra = 0 ad = 0 cd = 0 rcode = SERVFAIL
;; qdcount = 1 ancount = 0 nscount = 0 arcount = 0
;; QUESTION SECTION (1 record)
;; net.hu. IN SOA
;; ANSWER SECTION (0 records)
;; AUTHORITY SECTION (0 records)
;; ADDITIONAL SECTION (0 records)
;; _dorecursion() Response received from [193.6.16.1]
x