Skip Menu |

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

Report information
The Basics
Id: 50704
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Net-Nslookup

People
Owner: darren [...] cpan.org
Requestors: adam_lounds [...] hotmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.18
Fixed in: 1.19



Subject: CNAME lookups are just A lookups in disguise (patch included)
my %_lookups = ( 'a' => \&_lookup_a, 'cname' => \&_lookup_a, ... Ugh. --- /usr/lib/perl5/site_perl/5.8.5/Net/Nslookup.pm 2008-04-15 16:20:54.000000000 +0100 +++ Net/Nslookup.pm 2009-10-21 00:26:42.000000000 +0100 @@ -43,7 +43,7 @@ my %_lookups = ( 'a' => \&_lookup_a, - 'cname' => \&_lookup_a, + 'cname' => \&_lookup_cname, 'mx' => \&_lookup_mx, 'ns' => \&_lookup_ns, 'ptr' => \&_lookup_ptr, @@ -147,6 +147,21 @@ return @answers; } +sub _lookup_cname { + my ($term, $server) = @_; + my $res = ns($server); + my (@answers, $query, $rr); + + debug("Performing 'CNAME' lookup on `$term'"); + + $query = $res->search($term, "CNAME") || return; + for $rr ($query->answer) { + push @answers, $rr->cname; + } + + return @answers; +} + sub _lookup_ptr { my ($term, $server) = @_; my $res = ns($server);
Adam, Thanks for your patch. I'm not sure what happened, this is kind of a bone-headed bug. I've applied your patch, minted a new version (1.19), and uploaded it to CPAN. You can view the commit at http://github.com/dlc/net--nslookup/commit/e340dc49db8659df2a000a1940ad57de6e1d67f9 . Thanks for the bug report.
From: adam_lounds [...] hotmail.com
Wow, thanks for updating so quickly. Just realised how terse the original bug report was - forgot to say a big Thanks for writing the module which made writing my code much easier. You rock!
On Fri Oct 23 03:57:04 2009, adam_lounds@hotmail.com wrote: Show quoted text
> Wow, thanks for updating so quickly.
Well, it was a dumb bug, and you included a patch. What else could I do? :) Show quoted text
> Just realised how terse the original bug report was - forgot to say a > big Thanks for writing the module which made writing my code much > easier. You rock!
And with that, I shall resolve this ticket. Thank you for shopping at CPAN. :)