Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: hsalgado [...] vulcano.cl
Cc:
AdminCc:

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



Subject: Resolver with nameserver only in IPv6 is broken
When you assign a nameserver to a Net::DNS::Resolver object via name, with "nameservers" method, is only tested its IPv4 address. In Resolver/Base.pm, line 347: my $packet = $defres->search($ns); there's an assumption that there's an A record. In case of failure is needed another attempt with: $packet = $defres->search($ns, 'AAAA'); for names that only have IPv6 addresses.
El Mar Mar 08 13:56:56 2011, HUGUEI escribió: Show quoted text
> When you assign a nameserver to a Net::DNS::Resolver object via name, > with "nameservers" method, is only tested its IPv4 address. > > In Resolver/Base.pm, line 347: > my $packet = $defres->search($ns); > there's an assumption that there's an A record. In case of failure is > needed another attempt with: > $packet = $defres->search($ns, 'AAAA'); > for names that only have IPv6 addresses.
Besides that, a fix is needed inside "cname_addr" to allow AAAA types.
A working patch is included.
Subject: Net-DNS-Resolver-Base.pm.patch
--- Base-orig.pm 2011-03-08 16:47:31.000000000 -0300 +++ Base.pm 2011-03-08 16:48:53.000000000 -0300 @@ -349,6 +349,13 @@ if (defined($packet)) { push @a, cname_addr([@names], $packet); } + else { + $packet = $defres->search($ns, 'AAAA'); + $self->errorstring($defres->errorstring); + if (defined($packet)) { + push @a, cname_addr([@names], $packet); + } + } } } @@ -390,6 +397,9 @@ push(@addr, $1) } + elsif ($rr->type eq 'AAAA') { + push(@addr, $rr->address) + } }
When will this patch be applied and a new version released?
On Mon 17 Oct 2011 12:07:47, ABRAXXA wrote: Show quoted text
> When will this patch be applied and a new version released?
Hi Alex, Your patch looks pretty solid. I will try it out and if all is well I will include it in the next release which will follow soon. Thanks! Willem
Hi Hugo, I adjusted the patch a little bit. CNAMEs to AAAAs did not work yet because a query for an A record returns the CNAME without an A record, which would prevent Net::DNS::Resolver to retry with AAAA. Further improvements could try to actually follow the CNAME, but alas, for now CNAMEs to AAAAs in-bailiwick will now work. Thanks for the patch! -- Willem