Subject: | Resolver behaves differently with long and short IPv6 address format |
Date: | Thu, 19 Nov 2015 09:30:40 +0100 |
To: | bug-Net-DNS [...] rt.cpan.org |
From: | "Erik P. Ostlyngen" <erik [...] uninett.no> |
Hi,
I've found that the resolver (Net::DNS::Resolver) behaves differently
depending on the format I use for the nameserver IPv6 addresses. Example:
use Net::DNS;
my $r = Net::DNS::Resolver->new(
nameservers => ['2400:cb00:2049:1:0:0:a29f:21'],
);
my $p = $r->query('cloudflare.com', 'SOA');
print $p ? $p->string : 'NO ANSWER';
This prints 'NO ANSWER'. If I replace the IPv6-address with the
shorthand notation 2400:cb00:2049:1::a29f:21, I get an answer:
;; Answer received from 2400:cb00:2049:1::a29f:21 (120 bytes)
;; HEADER SECTION
;; id = 48969
;; 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 = 2
;; do = 0
;; QUESTION SECTION (1 record)
;; cloudflare.com. IN SOA
;; ANSWER SECTION (1 record)
cloudflare.com. 86400 IN SOA ( ns3.cloudflare.com.
dns.cloudflare.com.
2019938632 ;serial
10000 ;refresh
2400 ;retry
604800 ;expire
3600 ;minimum
)
;; AUTHORITY SECTION (0 records)
;; ADDITIONAL SECTION (2 records)
ns3.cloudflare.com. 900 IN AAAA 2400:cb00:2049:1::a29f:21
ns3.cloudflare.com. 900 IN A 162.159.0.33
My version of Net-DNS: 1.03 (built from CPAN using dh-make-perl and
debuild -uc -us -sa)
Perl version: perl 5, version 14, subversion 2 (v5.14.2) built for
x86_64-linux-gnu-thread-multi
OS: Linux uro 3.2.0-89-generic #127-Ubuntu SMP Tue Jul 28 09:28:15 UTC
2015 x86_64 x86_64 x86_64 GNU/Linux
Kind regards,
Erik Østlyngen
UNINETT Norid