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)