Skip Menu |

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

Report information
The Basics
Id: 5403
Status: resolved
Priority: 0/
Queue: Net-DNS

People
Owner: rt-cpan [...] triv.org
Requestors: frederic.planchon [...] wanadoo.com
Cc:
AdminCc:

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



Subject: Problem with NS query
We cannot retrieve NS records with query method when DNS server answer like RFC 1034 precognize (section 4.3.2) when it's a referral. -- dig command -- ; <<>> DiG 9.2.3 <<>> com ns @B.ROOT-SERVERS.NET +norecurse ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6441 ;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 13, ADDITIONAL: 13 ;; QUESTION SECTION: ;com. IN NS ;; AUTHORITY SECTION: com. 172800 IN NS A.GTLD-SERVERS.NET. com. 172800 IN NS G.GTLD-SERVERS.NET. com. 172800 IN NS H.GTLD-SERVERS.NET. com. 172800 IN NS C.GTLD-SERVERS.NET. com. 172800 IN NS I.GTLD-SERVERS.NET. com. 172800 IN NS B.GTLD-SERVERS.NET. com. 172800 IN NS D.GTLD-SERVERS.NET. com. 172800 IN NS L.GTLD-SERVERS.NET. com. 172800 IN NS F.GTLD-SERVERS.NET. com. 172800 IN NS J.GTLD-SERVERS.NET. com. 172800 IN NS K.GTLD-SERVERS.NET. com. 172800 IN NS E.GTLD-SERVERS.NET. com. 172800 IN NS M.GTLD-SERVERS.NET. ;; ADDITIONAL SECTION: A.GTLD-SERVERS.NET. 172800 IN A 192.5.6.30 G.GTLD-SERVERS.NET. 172800 IN A 192.42.93.30 H.GTLD-SERVERS.NET. 172800 IN A 192.54.112.30 C.GTLD-SERVERS.NET. 172800 IN A 192.26.92.30 I.GTLD-SERVERS.NET. 172800 IN A 192.43.172.30 B.GTLD-SERVERS.NET. 172800 IN A 192.33.14.30 D.GTLD-SERVERS.NET. 172800 IN A 192.31.80.30 L.GTLD-SERVERS.NET. 172800 IN A 192.41.162.30 F.GTLD-SERVERS.NET. 172800 IN A 192.35.51.30 J.GTLD-SERVERS.NET. 172800 IN A 192.48.79.30 K.GTLD-SERVERS.NET. 172800 IN A 192.52.178.30 E.GTLD-SERVERS.NET. 172800 IN A 192.12.94.30 M.GTLD-SERVERS.NET. 172800 IN A 192.55.83.30 ;; Query time: 212 msec ;; SERVER: 192.228.79.201#53(B.ROOT-SERVERS.NET) ;; WHEN: Fri Feb 20 19:44:32 2004 ;; MSG SIZE rcvd: 453 --- end dig command -- As you can see NS answer are in the Authority section. So when I use Net::DNS::Resolver::query, it return undef, but it's an answer. It should return a Net::DNS::Packet and I could get Authority section. If I should use another way, you must better include this in your documentation. If you need another information contact me. ----- Distribution name and version : Net-DNS-0.45 Perl version : 5.6.1 / 5.8.2 perating System vendor and version: Linux <computer name> 2.4.20-13.7custom #2 <date> i686 unknown / Linux <computer name> 2.4.24 #1 <date> i686 GNU/Linux -- Code example : use strict; use Net::DNS; my $res = Net::DNS::Resolver->new; $res->defnames(0); $res->dnsrch(0); $res->recurse(0); $res->nameservers("B.ROOT-SERVERS.NET"); my $packet = $res->query("com", "NS"); if( !defined($packet) ) { warn "possible bug in Net::DNS\n"; } else { $packet->print; }
From: Chris Reinhardt <chris [...] dyndns.org>
Subject: Re: [cpan #5403] Problem with NS query
Date: Sat, 21 Feb 2004 01:06:24 -0500
To: bug-Net-DNS [...] rt.cpan.org
RT-Send-Cc:
On Feb 20, 2004, at 1:57 PM, Guest via RT wrote: Show quoted text
> > As you can see NS answer are in the Authority section. So when I use > Net::DNS::Resolver::query, it return undef, but it's an answer. It > should return a Net::DNS::Packet and I could get Authority section.
No. By design query() and search() only return a packet object if the answer section contains records. If you need to see the packet regardless of the answer section, use send(). Show quoted text
> If I should use another way, you must better include this in your > documentation.
This is already in the FAQ and the Net::DNS::Resolver POD, but I will endeavor to make this point more clear in the documentation. -- Chris Reinhardt -- chris@dyndns.org -- http://www.dyndns.org/ I believe that Ronald Reagan can make this country what it once was - an Arctic region covered with ice. --Steve Martin