Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: JANW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.27
Fixed in: (no value)



Subject: Bug with IPv6-only domains
Resolver requests for domains that only have an AAAA record result in a crash: empty domain label at /usr/lib/x86_64-linux-gnu/perl5/5.22/Net/DNS/Question.pm line 80. Example: my $res = Net::DNS::Resolver->new; $res->search('ipv6.l.google.com'); Workaround: $res->search('ipv6.l.google.com', 'ANY');
On Wed Oct 07 07:02:22 2020, JANW wrote: Show quoted text
> Resolver requests for domains that only have an AAAA record result in > a crash: > empty domain label at /usr/lib/x86_64-linux- > gnu/perl5/5.22/Net/DNS/Question.pm line 80.
If you are claiming a crash, please provide supporting evidence. Show quoted text
> > Example: > > my $res = Net::DNS::Resolver->new; > $res->search('ipv6.l.google.com');
The documentation clearly says: The record type and class can be omitted; they default to A and IN. There are no A records, so your example (with debug and using Google nameserver) produces: ;; search( ipv6.l.google.com A ) ;; udp send [2001:4860:4802:32:0:0:0:a]:53 ;; reply from [2001:4860:4802:32:0:0:0:a] 63 bytes ;; HEADER SECTION ;; id = 61419 ;; qr = 1 aa = 1 tc = 0 rd = 1 opcode = QUERY ;; ra = 0 z = 0 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 0 nscount = 1 arcount = 0 ;; do = 0 ;; QUESTION SECTION (1 record) ;; ipv6.l.google.com. IN A ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (1 record) l.google.com. 60 IN SOA ( ns1.google.com. dns admin.google.com. 336439620 ;serial 900 ;refresh 900 ;retry 1800 ;expire 60 ;minimum ) ;; ADDITIONAL SECTION (0 records) Show quoted text
> > Workaround: > $res->search('ipv6.l.google.com', 'ANY');
This is more complicated and definitely not the general solution you believe it to be. The response will depend on which nameserver answers the query: 1) There may be no response at all. 2) There might be a response with the TC bit set, but otherwise empty, intended to force a retry over TCP. ;; search( ipv6.l.google.com ANY ) ;; udp send [192.168.65.1]:53 ;; reply from [192.168.65.1] 35 bytes ;; HEADER SECTION ;; id = 49283 ;; qr = 1 aa = 0 tc = 1 rd = 1 opcode = QUERY ;; ra = 0 z = 0 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 0 nscount = 0 arcount = 0 ;; do = 0 ;; QUESTION SECTION (1 record) ;; ipv6.l.google.com. IN ANY ;; ANSWER SECTION (0 records) ;; AUTHORITY SECTION (0 records) ;; ADDITIONAL SECTION (0 records) ;; errorstring: NOERROR ;; packet truncated: retrying using TCP ;; tcp send [192.168.65.1] 3) If you are lucky, as in this case ;; search( ipv6.l.google.com ANY ) ;; udp send [2001:4860:4802:32:0:0:0:a]:53 ;; reply from [2001:4860:4802:32:0:0:0:a] 63 bytes ;; HEADER SECTION ;; id = 38115 ;; qr = 1 aa = 1 tc = 0 rd = 1 opcode = QUERY ;; ra = 0 z = 0 ad = 0 cd = 0 rcode = NOERROR ;; qdcount = 1 ancount = 1 nscount = 0 arcount = 0 ;; do = 0 ;; QUESTION SECTION (1 record) ;; ipv6.l.google.com. IN ANY ;; ANSWER SECTION (1 record) ipv6.l.google.com. 300 IN AAAA 2a00:1450:4009:81b::200e ;; AUTHORITY SECTION (0 records) ;; ADDITIONAL SECTION (0 records)
On Sat Oct 10 12:24:38 2020, rwfranks@acm.org wrote: Show quoted text
> If you are claiming a crash, please provide supporting evidence.
Instead of providing an empty result set as it should, the modules ends in a die() when you run this my $res = Net::DNS::Resolver->new; $res->search('ipv6.l.google.com'); print "We never get here\n";
On Sat Oct 10 12:32:17 2020, JANW wrote: Show quoted text
> On Sat Oct 10 12:24:38 2020, rwfranks@acm.org wrote:
> > If you are claiming a crash, please provide supporting evidence.
> > Instead of providing an empty result set as it should, the modules > ends in a die() when you run this > > my $res = Net::DNS::Resolver->new; > $res->search('ipv6.l.google.com'); > print "We never get here\n";
[rwf@pandora tmp]$ cat test.pl use Net::DNS; my $res = Net::DNS::Resolver->new; $res->search('ipv6.l.google.com'); print "We never get here\n"; [rwf@pandora tmp]$ perl test.pl We never get here I always get there!
What does $res->print look like?
It looks like this was the result of a broken installation. It doesn't happen on a clean install.