Skip Menu |

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

Report information
The Basics
Id: 3969
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Net-DNS

People
Owner: bbb [...] cpan.org
Requestors: lorenzo [...] reality.it
Cc:
AdminCc:

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



Subject: Endless Loop in SOA query
I try to make a query for a SOA record for dns.iit.cnr.it (and others). dns.iit.cnr.it has not SOA record it's only a host, but Net::DNS::Resolver doesn't give an answer and go in an endless loop. You can find in attachment a file with detail of the Net::DNS Debug and the perl script. If you need more information, please don't hesitate to ask. Ciao, Lorenzo
Download error
application/octet-stream 15.7k

Message body not shown because it is not plain text.

RT-Send-CC: bbb [...] cpan.org
[guest - Fri Oct 3 12:00:04 2003]: Show quoted text
> I try to make a query for a SOA record for dns.iit.cnr.it (and others). > dns.iit.cnr.it has not SOA record it's only a host, but > Net::DNS::Resolver doesn't give an answer and go in an endless loop.
This is actually a bug in Net::DNS::Resolver::Recursive, not Net::DNS::Resolver. I have CC'ed the author of Net::DNS::Resolver::Recursive, perhaps he can shed some light on the issue. This is something that the recursive resolver should be able to handle, as it's a standard response in this situation (DNS really sucks sometimes). I think we should just handle this special case and return the packet with the single SOA record in the authority section. -- Chris Reinhardt ctriv@dyndns.org Systems Architect Dynamic DNS Network Services http://www.dyndns.org/
RT-Send-CC: bbb [...] cpan.org
This is a specific case of a more general bug, that being: A query for a type on an entry that does exist but does not have that specific type, causes an infinite loop. Example: $ dig -tTXT ns1.netscape.com. ; <<>> DiG 9.2.2-P2 <<>> -tTXT ns1.netscape.com. ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44700 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;ns1.netscape.com. IN TXT ;; AUTHORITY SECTION: netscape.com. 515 IN SOA ns.netscape.com. dnsmaster.netscape.com. 2003102000 3600 900 604800 600 ;; Query time: 22 msec ;; SERVER: 216.190.237.135#53(216.190.237.135) ;; WHEN: Fri Oct 24 17:09:02 2003 ;; MSG SIZE rcvd: 83 $ Trying to run this same query through Net::DNS::Resolver::Recurse would cause the loop because NS1.NETSCAPE.COM does have a record for type "A" but none from type "TXT". Here is the equivalent perl code which of course will hang: #!perl use Net::DNS::Resolver::Recurse; my $res = new Net::DNS::Resolver::Recurse; my $packet = $res->query_dorecursion("ns1.netscape.com.", "TXT"); On Tue, 14 Oct 2003, Chris Reinhardt wrote: Show quoted text
> I think we should just handle this special case > and return the packet with the single SOA > record in the authority section.
I disagree. As stated in the documentation, query_dorecursion is intended to behave just like query, except doing the recursion itself instead of asking another resolver to do it. The normal query method of Net::DNS::Resolver would return undef because the answer section is empty. Some applications depend on this functionality and returning the packet itself would yield a "true" value but without answers.
RT-Send-CC: bbb [...] cpan.org
[BBB - Fri Oct 24 19:52:23 2003]: Show quoted text
> This patch causes query_dorecursion() to > return undef (matching what query() would do) in > this particular case. I don't think I have cvs > access or I would've committed it myself so you'll > have to review and apply the changes yourself as > you see appropriate. It was applied against the > latest version I found from CPAN (0.41). If it's > okay, then it should be fixed in the next release. > Otherwise, just let me know.
Thanks, Applied. -- Chris Reinhardt ctriv@dyndns.org Systems Architect Dynamic DNS Network Services http://www.dyndns.org/