Skip Menu |
 

This queue is for tickets about the Net-DNS CPAN distribution.

Report information
The Basics
Id: 12720
Status: deleted
Priority: 0/
Queue: Net-DNS

People
Owner: OLAF [...] cpan.org
Requestors: lorenzo.luconi [...] iit.cnr.it
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.49
Fixed in: (no value)

Attachments


Subject: Net::DNS::Resolver::Recurse
Download (untitled) / with headers
text/plain 1.1k
Hi, I'm developping a dns check module based on Net::DNS. In these days I'm doing massive tests of my module, checking more than 30.000 domain names, but I found a problem with Net::DNS::Resolver:Recurse. Sometime my "massive check" script dies at line 125 of ..../Net/DNS/Resolver/Recurse.pm. Looking source code at line 125 I found this: die "Recursion too deep, aborting..." if $depth > 255; This happens when there are to many depth in recursion process. At present I don't know if the problem occur for an error on nameserver configuration or for some bugs somewhere (i tried many times to reproduce this error without, at present, any result). Anyway I think a 'die' instruction here is not the best idea. Probably it would be better to generate some kind of error code and return it to the application or return a false value (_dorecursion function). What you think about this? I started again my test for 20.000 domains and is running now. I have modifed my script for storing debug information generated by Net::DNS. If the problem accour I'll be able to send to you the debug output. Thank you. Ciao, Lorenzo
From: lorenzo.luconi [...] iit.cnr.it
Download (untitled) / with headers
text/plain 1.3k
Hi, after about 5.000 domains checked i found a recurse query that goes in loop. Please see the attached debug output for more details. Ciao, Lorenzo Show quoted text
> Hi, > > I'm developping a dns check module based on Net::DNS. > In these days I'm doing massive tests of my module, checking more than > 30.000 domain names, but I found a problem with > Net::DNS::Resolver:Recurse. Sometime my "massive check" script dies > at line 125 of ..../Net/DNS/Resolver/Recurse.pm. > > Looking source code at line 125 I found this: > die "Recursion too deep, aborting..." if $depth > 255; > > This happens when there are to many depth in recursion process. At > present I don't know if the problem occur for an error on > nameserver configuration or for some bugs somewhere (i tried many > times to reproduce this error without, at present, any result). > Anyway I think a 'die' instruction here is not the best idea. > Probably it would be better to generate some kind of error code and > return it to the application or return a false value (_dorecursion > function). > > What you think about this? > > I started again my test for 20.000 domains and is running now. I have > modifed my script for storing debug information generated by > Net::DNS. If the problem accour I'll be able to send to you the > debug output. > > Thank you. > > Ciao, > Lorenzo > >
Download Recurse loop.txt
text/plain 9.2k
[... skip ...] ;; _dorecursion() depth=[0] known_zone=[.] ;; _dorecursion() cutting deck of (13) authorities... ;; _dorecursion() First nameserver [192.228.79.201] ;; send_udp(192.228.79.201:53) ;; answer from 192.228.79.201:53 : 378 bytes ;; HEADER SECTION ;; id = 35295 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 0 ;; ra = 0 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 0 nscount = 8 arcount = 8 ;; QUESTION SECTION (1 record) ;; b.ns.californiture.it. IN A ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (8 records) it. 172800 IN NS NAMESERVER.CNR.it. it. 172800 IN NS DNS.NIC.it. it. 172800 IN NS DNS2.IT.NET. it. 172800 IN NS NS.RIPE.NET. it. 172800 IN NS SERVER2.INFN.it. it. 172800 IN NS DNS2.IUNET.it. it. 172800 IN NS AUTH2.DNS.COGENTCO.COM. it. 172800 IN NS IT2.MIX-IT.NET. ;; ADDITIONAL SECTION (8 records) NAMESERVER.CNR.it. 172800 IN A 194.119.192.34 DNS.NIC.it. 172800 IN A 193.205.245.5 DNS2.IT.NET. 172800 IN A 151.1.2.1 NS.RIPE.NET. 172800 IN A 193.0.0.193 SERVER2.INFN.it. 172800 IN A 131.154.1.3 DNS2.IUNET.it. 172800 IN A 192.106.1.31 AUTH2.DNS.COGENTCO.COM. 172800 IN A 66.28.0.30 IT2.MIX-IT.NET. 172800 IN A 217.29.76.4 ;; _dorecursion() Response received from [192.228.79.201] ;; _dorecursion() Received authority [it.] [NS] [nameserver.cnr.it.] ;; _dorecursion() FOUND closer authority for [it.] at [nameserver.cnr.it.]. ;; _dorecursion() Received authority [it.] [NS] [dns.nic.it.] ;; _dorecursion() FOUND closer authority for [it.] at [dns.nic.it.]. ;; _dorecursion() Received authority [it.] [NS] [dns2.it.net.] ;; _dorecursion() FOUND closer authority for [it.] at [dns2.it.net.]. ;; _dorecursion() Received authority [it.] [NS] [ns.ripe.net.] ;; _dorecursion() FOUND closer authority for [it.] at [ns.ripe.net.]. ;; _dorecursion() Received authority [it.] [NS] [server2.infn.it.] ;; _dorecursion() FOUND closer authority for [it.] at [server2.infn.it.]. ;; _dorecursion() Received authority [it.] [NS] [dns2.iunet.it.] ;; _dorecursion() FOUND closer authority for [it.] at [dns2.iunet.it.]. ;; _dorecursion() Received authority [it.] [NS] [auth2.dns.cogentco.com.] ;; _dorecursion() FOUND closer authority for [it.] at [auth2.dns.cogentco.com.]. ;; _dorecursion() Received authority [it.] [NS] [it2.mix-it.net.] ;; _dorecursion() FOUND closer authority for [it.] at [it2.mix-it.net.]. ;; _dorecursion() STORING: nameserver.cnr.it. IN A 194.119.192.34 ;; _dorecursion() STORING: dns.nic.it. IN A 193.205.245.5 ;; _dorecursion() STORING: dns2.it.net. IN A 151.1.2.1 ;; _dorecursion() STORING: ns.ripe.net. IN A 193.0.0.193 ;; _dorecursion() STORING: server2.infn.it. IN A 131.154.1.3 ;; _dorecursion() STORING: dns2.iunet.it. IN A 192.106.1.31 ;; _dorecursion() STORING: auth2.dns.cogentco.com. IN A 66.28.0.30 ;; _dorecursion() STORING: it2.mix-it.net. IN A 217.29.76.4 ;; _dorecursion() depth=[1] known_zone=[it.] ;; _dorecursion() cutting deck of (8) authorities... ;; _dorecursion() First nameserver [131.154.1.3] ;; send_udp(131.154.1.3:53) ;; answer from 131.154.1.3:53 : 119 bytes ;; HEADER SECTION ;; id = 35295 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 0 ;; ra = 1 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 0 nscount = 2 arcount = 2 ;; QUESTION SECTION (1 record) ;; b.ns.californiture.it. IN A ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (2 records) californiture.it. 86400 IN NS scirocco.tiscalinet.it. californiture.it. 86400 IN NS b.ns.californiture.it. ;; ADDITIONAL SECTION (2 records) b.ns.californiture.it. 86400 IN A 195.130.225.81 scirocco.tiscalinet.it. 9639 IN A 195.130.225.42 ;; _dorecursion() Response received from [131.154.1.3] ;; _dorecursion() Received authority [californiture.it.] [NS] [scirocco.tiscalinet.it.] ;; _dorecursion() FOUND closer authority for [californiture.it.] at [scirocco.tiscalinet.it.]. ;; _dorecursion() Received authority [californiture.it.] [NS] [b.ns.californiture.it.] ;; _dorecursion() FOUND closer authority for [californiture.it.] at [b.ns.californiture.it.]. ;; _dorecursion() STORING: b.ns.californiture.it. IN A 195.130.225.81 ;; _dorecursion() STORING: scirocco.tiscalinet.it. IN A 195.130.225.42 ;; _dorecursion() depth=[2] known_zone=[californiture.it.] ;; _dorecursion() cutting deck of (2) authorities... ;; _dorecursion() First nameserver [195.130.225.81] ;; send_udp(195.130.225.81:53) ;; answer from 195.130.225.81:53 : 266 bytes ;; HEADER SECTION ;; id = 35295 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 0 ;; ra = 0 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 0 nscount = 8 arcount = 1 ;; QUESTION SECTION (1 record) ;; b.ns.californiture.it. IN A ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (8 records) it. 64379 IN NS IT2.MIX-IT.NET. it. 64379 IN NS DNS2.IT.NET. it. 64379 IN NS DNS2.IUNET.it. it. 64379 IN NS AUTH2.DNS.COGENTCO.COM. it. 64379 IN NS SERVER2.INFN.it. it. 64379 IN NS NAMESERVER.CNR.it. it. 64379 IN NS NS.RIPE.NET. it. 64379 IN NS DNS.NIC.it. ;; ADDITIONAL SECTION (1 record) NS.RIPE.NET. 64379 IN A 193.0.0.193 ;; _dorecursion() Response received from [195.130.225.81] ;; _dorecursion() Received authority [it.] [NS] [it2.mix-it.net.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [dns2.it.net.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [dns2.iunet.it.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [auth2.dns.cogentco.com.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [server2.infn.it.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [nameserver.cnr.it.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [ns.ripe.net.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [dns.nic.it.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Ignoring useless: NS.RIPE.NET. 64379 IN A 193.0.0.193 ;; _dorecursion() depth=[3] known_zone=[californiture.it.] ;; _dorecursion() cutting deck of (2) authorities... ;; _dorecursion() First nameserver [195.130.225.81] ;; send_udp(195.130.225.81:53) ;; answer from 195.130.225.81:53 : 266 bytes ;; HEADER SECTION ;; id = 35295 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 0 ;; ra = 0 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 0 nscount = 8 arcount = 1 ;; QUESTION SECTION (1 record) ;; b.ns.californiture.it. IN A ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (8 records) it. 64379 IN NS NAMESERVER.CNR.it. it. 64379 IN NS NS.RIPE.NET. it. 64379 IN NS DNS.NIC.it. it. 64379 IN NS IT2.MIX-IT.NET. it. 64379 IN NS DNS2.IT.NET. it. 64379 IN NS DNS2.IUNET.it. it. 64379 IN NS AUTH2.DNS.COGENTCO.COM. it. 64379 IN NS SERVER2.INFN.it. ;; ADDITIONAL SECTION (1 record) NS.RIPE.NET. 64379 IN A 193.0.0.193 ;; _dorecursion() Response received from [195.130.225.81] ;; _dorecursion() Received authority [it.] [NS] [nameserver.cnr.it.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [ns.ripe.net.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [dns.nic.it.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [it2.mix-it.net.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [dns2.it.net.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [dns2.iunet.it.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [auth2.dns.cogentco.com.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Received authority [it.] [NS] [server2.infn.it.] ;; _dorecursion() Deadbeat name server did not provide new information. ;; _dorecursion() Ignoring useless: NS.RIPE.NET. 64379 IN A 193.0.0.193 ;; _dorecursion() depth=[4] known_zone=[californiture.it.] ;; _dorecursion() cutting deck of (2) authorities... ;; _dorecursion() First nameserver [195.130.225.42] ;; send_udp(195.130.225.42:53) ;; answer from 195.130.225.42:53 : 282 bytes ;; HEADER SECTION ;; id = 35295 ;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 0 ;; ra = 0 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 0 nscount = 8 arcount = 2 ;; QUESTION SECTION (1 record) ;; b.ns.californiture.it. IN A .... the same until depth 255 and then dies.
Download (untitled) / with headers
text/plain 457b
[guest - Sun May 8 15:14:56 2005]: Show quoted text
> Hi, > > after about 5.000 domains checked i found a recurse query that goes in
loop. Show quoted text
> > Please see the attached debug output for more details. >
Thanks this helps. Its clear that californiture.it has some kind of broken DNS setup. I've glanced over the debug info but to properly analyze this needs more time than I have now. I hope I can reproduce the bug when I get around to looking at this in more detail.
From: lorenzo.luconi [...] iit.cnr.it
Download (untitled) / with headers
text/plain 3.2k
Hi, Thanks to you for your reply and for the support to Net::DNS! :-) I look deeper at the source code of Resolver.pm and probably I found the problem. First of all I changed the 'die' instruction to something like this (line 125): # die "Recursion too deep, aborting..." if $depth > 255; if ( $depth > 255 ) { print ";; _dorecursion() Recursion too deep, aborting...\n" if $self->{'debug'}; return undef; } With this change my script report the error but it doesn't die anymore! :-) The domain californiture.it has two delegated ns servers: b.ns.californiture.it scirocco.tiscalinet.it Both this two ns return a not authoritative answer for californiture.it and return in the authority section information about the domain IT. The problem during resolution happens when we ask for A RR of b.ns.californiture.it. I found the problem located in this portion of source code of Recurse.pm (line 432): if ($of =~ /$known_zone$/) { return $self->_dorecursion( $query_packet, $of, \%auth, $depth+1 ); } else { return $self->_dorecursion( $query_packet, $known_zone, $known_authorities, $depth+1 ); } If the recursive process is ok (no lame delegation, or other) it use always the true portion. The problem is in the false portion: when the 'if test' is false it means that we got an "answer" from querried nameserver that is useless for our recursion process. For example for californiture.it we go in loop because: - $of = 'it.' (is equal to 'it.' because this is the $rr->name from authority section RR) - $known_zone = 'californiture.it.' So the 'if test' is false and we call _dorecursion with: - $known_zone = 'californiture.it.' - $known_authorities = { 'scirocco.tiscalinet.it' => ['195.130.225.42'], 'b.ns.californiture.it' => ['195.130.225.81'] } The problem is $known_authorities that never changes. Both ns are not authoritative for domain so I can query them and I'll get always the same answer (useless answer). So we have to remove from $known_authorities the nameserver that give us the no-good answer and if none of auth nameservers return a usefull answer we have to stop the recursive resolution process when $known_authorities is empty. Unfortunely we don't know the name of the nameserver that answered to query but only the ip address ($self->answerform). So I make these changes to the 'if': if ($of =~ /$known_zone$/) { return $self->_dorecursion( $query_packet, $of, \%auth, $depth+1 ); } else { while ( my ($nsname, $nsarray) = each %{$known_authorities} ) { if ( grep { $_ eq $self->answerfrom} @{$nsarray} ) { delete $known_authorities->{$nsname}; print ";; _dorecursion() remove $nsname (", join(',',@{$nsarray}) ,") from known_authorities\n" if $self->{'debug'}; } } if ( keys %{$known_authorities} ) { return $self->_dorecursion( $query_packet, $known_zone, $known_authorities, $depth+1 ); } } My english is not good, but I hope is clear enough for you and this help you to fix the problem. Ciao, Lorenzo Luconi Trombacchi Show quoted text
> Thanks this helps. > > Its clear that californiture.it has some kind of broken DNS setup. > > I've glanced over the debug info but to properly analyze this needs more > time than I have now. I hope I can reproduce the bug when I get around > to looking at this in more detail. >
Download (untitled) / with headers
text/plain 813b
Show quoted text
> # die "Recursion too deep, aborting..." if $depth > 255; > if ( $depth > 255 ) { > print ";; _dorecursion() Recursion too deep, aborting...\n" if > $self->{'debug'}; > return undef; > }
I did apply this particular patch. The other patch I did not apply because I had a problem with really understanding (and reproducing the particular problem) It is not very clear what the servers at each level returned. If you could point me to the server setup where this problem occurs or could provide me with the exact description of what happens on each level (what servers provide which information) than I can reproduce the error and try to fix it. Without a test case I am reluctant to make any changes. I stall the ticket for now. If I do not see follow up I will at some point close the ticket.
Download (untitled) / with headers
text/plain 1.1k
[OLAF - Wed Nov 16 09:17:53 2005]: Hi, Show quoted text
> > # die "Recursion too deep, aborting..." if $depth > 255; > > if ( $depth > 255 ) { > > print ";; _dorecursion() Recursion too deep, aborting...\n" if > > $self->{'debug'}; > > return undef; > > }
> > I did apply this particular patch.
thank you for this patch.... After some months I don't remember a lot about the problem. I tried to answer to the question "why recursion goes in loop and reach 255 depth". I'll try to refresh my memory and I'll send to you more information as soon as possibile. Lorenzo Show quoted text
> > The other patch I did not apply because I had a problem with really > understanding (and > reproducing the particular problem) It is not very clear what the > servers at each level > returned. > > If you could point me to the server setup where this problem occurs or > could provide me with > the exact description of what happens on each level (what servers > provide which information) > than I can reproduce the error and try to fix it. > > Without a test case I am reluctant to make any changes. > > I stall the ticket for now. If I do not see follow up I will at some > point close the ticket. >
From: rwfranks [...] acm.org
Download (untitled) / with headers
text/plain 1.2k
On Wed Nov 16 09:17:53 2005, OLAF wrote: Show quoted text
> > # die "Recursion too deep, aborting..." if $depth > 255; > > if ( $depth > 255 ) { > > print ";; _dorecursion() Recursion too deep, aborting...\n" if > > $self->{'debug'}; > > return undef; > > }
> > I did apply this particular patch. > > The other patch I did not apply because I had a problem with really > understanding (and > reproducing the particular problem) It is not very clear what the > servers at each level > returned. > > If you could point me to the server setup where this problem occurs or > could provide me with > the exact description of what happens on each level (what servers > provide which information) > than I can reproduce the error and try to fix it. > > Without a test case I am reluctant to make any changes. > > I stall the ticket for now. If I do not see follow up I will at some > point close the ticket. >
Five years on, californiture.it is as bad as ever! [rwf@tosh net-dns]$ time contrib/check_soa californiture.it ### SERVFAIL: californiture.it. IN SOA ---- [1] b.ns.californiture.it ### unresolved server name [2] scirocco.tiscalinet.it (195.130.225.42) ### no response Unsatisfactory response from 2 nameservers real 2m21.499s user 0m0.120s sys 0m0.017s
Subject: Re: [rt.cpan.org #12720] Net::DNS::Resolver::Recurse
Date: Sat, 15 Jan 2011 10:15:13 +0100
To: bug-Net-DNS [...] rt.cpan.org
From: Lorenzo Luconi Trombacchi <lorenzo.luconi [...] iit.cnr.it>
Download (untitled) / with headers
text/plain 1.4k
I submitted this bug long time ago. Sorry but I can't help you. You can close the ticket, for me. Lorenzo Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=12720 > > > On Wed Nov 16 09:17:53 2005, OLAF wrote:
>>> # die "Recursion too deep, aborting..." if $depth > 255; >>> if ( $depth > 255 ) { >>> print ";; _dorecursion() Recursion too deep, aborting...\n" if >>> $self->{'debug'}; >>> return undef; >>> }
>> >> I did apply this particular patch. >> >> The other patch I did not apply because I had a problem with really >> understanding (and >> reproducing the particular problem) It is not very clear what the >> servers at each level >> returned. >> >> If you could point me to the server setup where this problem occurs or >> could provide me with >> the exact description of what happens on each level (what servers >> provide which information) >> than I can reproduce the error and try to fix it. >> >> Without a test case I am reluctant to make any changes. >> >> I stall the ticket for now. If I do not see follow up I will at some >> point close the ticket. >>
> > Five years on, californiture.it is as bad as ever! > > [rwf@tosh net-dns]$ time contrib/check_soa californiture.it > ### SERVFAIL: californiture.it. IN SOA > ---- > > [1] b.ns.californiture.it > ### unresolved server name > > [2] scirocco.tiscalinet.it (195.130.225.42) > ### no response > > Unsatisfactory response from 2 nameservers > > > real 2m21.499s > user 0m0.120s > sys 0m0.017s >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.