Subject: | Net::DNS 0.72 can have errorstring empty after query fails |
Date: | 10 Jan 2013 18:04:25 +0000 |
To: | bug-Net-DNS [...] rt.cpan.org |
From: | Chris Thompson <cet1 [...] cam.ac.uk> |
I am (or was) trying to upgrade from 0.68 to 0.72.
OS is Solaris 10_x86. Prolem originally detected with OS-provided Perl (5.8.4)
but I get the same effect on another system with Perl 5.16.1. Not using XS
code in either case.
After a query method returns a false result, I get different results for
errorstring depending on whether usevc is set or not
errorstring from errorstring from
Actual rcode from the query version 0.68 version 0.72
usevc=0 usevc=1 usevc=0 usevc=1
NOERROR (i.e. "nodata") 'NOERROR' 'NOERROR' 'NOERROR' ''
NXDOMAIN 'NXDOMAIN' 'NXDOMAIN' 'NXDOMAIN' ''
REFUSED 'REFUSED' 'REFUSED' 'REFUSED' 'REFUSED'
I initially wondered if errorstring being empty was a (bad) change of spec,
but these results are so strange that it's surely a bug?
Test program was
#!/bin/perl -w
use strict;
use Net::DNS;
@ARGV >= 2 or die "$0: should have at least two arguments\n";
my ($name,$type,@ns) = @ARGV;
my $res = Net::DNS::Resolver->new ( dnsrch=>0, defnames=>0,
usevc=>1, # or usevc=>0, depending
nameservers=>\@ns );
my $query = $res->query($name,$type);
if ($query) {
print "Result of query for $name/$type is true\n";
}
else {
print "Result of query for $name/$type is false\n";
print "Errorstring is \'",$res->errorstring,"\'\n";
}
--
Chris Thompson
Email: cet1@cam.ac.uk