Skip Menu |

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

Report information
The Basics
Id: 67787
Status: rejected
Priority: 0/
Queue: Net-DNS

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

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



Subject: $resolver->query fails with NOERROR if acount == 0
$ dig -t MX cel.leonerd.org.uk ; <<>> DiG 9.7.3 <<>> -t MX cel.leonerd.org.uk ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 3317 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0 ;; QUESTION SECTION: ;cel.leonerd.org.uk. IN MX ;; AUTHORITY SECTION: ... No answers, because this domain name does not have an MX record. $ perl -MNet::DNS::Resolver -E'my $r = Net::DNS::Resolver->new; $r- Show quoted text
>query("cel.leonerd.org.uk", "MX") or die $r->errorstring'
NOERROR at -e line 1. This is not a very useful error result. It makes error reporting to the caller trickier, because this doesn't directly describe the failure. Perhaps the resolver's error string could be set to something indicating no DNS error, but no data was found in the result? Perhaps something similar to NODATA/NOADDRESS, as libc's res_query(3): $ perl -MNet::LibResolv=:errors -E'say NO_DATA' 4 $ perl -MNet::LibResolv=res_query,:types,:classes,\$h_errno - E'res_query("cel.leonerd.org.uk",NS_C_IN,NS_T_MX) or printf "%s (%d)\n", $h_errno, $h_errno' No address associated with name (4) -- Paul Evans
Although not documenten, the behaviour (API) would change. With the current response it is at least determinable if the answer was a NODATA. For more fine grained control one could always use send.
Hi Paul, I've looked at it again and I still think it is not an issue because the NODATA case is decidable: perl -MNet::DNS::Resolver -E'my $r = Net::DNS::Resolver->new; $r->query("cel.leonerd.org.uk", "MX") or die $r->errorstring eq "NOERROR" ? "NODATA" : $r->errorstring' So... I will reject the request. If you feel very strongly that I make a mistake, please reopen. Regards, -- Willem