Subject: | Net::DNS::Resolver->query when ancount = 0 return undef Net::DNS::Packet? |
Hello. This problem might be due to poor understanding of Net::DNS on my part, but I'd appreciate if you would take a look. The attached script queries for (00800inkjets.se, IN, NS) and receive an answer with an empty ANSWER section, but with some information in the AUTHORITY section. However, Net::DNS doesn't seem to like the response, and just return 'undef', so I can't look at the packet. If you need any more information, I will try to get it. Thank you.
Script:
#!/usr/bin/perl
use strict;
use Net::DNS;
my $res = Net::DNS::Resolver->new;
$res->nameservers("dnssec.nic-se.se");
$res->debug(1);
print "Net::DNS version ", $Net::DNS::VERSION, "\n";
my $query = $res->query("00800inkjets.se", "NS");
if ($query eq undef)
{
die "Query failed?!";
}
print "Ok\n";
Output:
Net::DNS version 0.46
;; query(00800inkjets.se, NS, IN)
;; send_udp(212.247.3.66:53)
;; answer from 212.247.3.66:53 : 80 bytes
;; HEADER SECTION
;; id = 17496
;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 1
;; ra = 0 ad = 0 cd = 0 rcode = NOERROR
;; qdcount = 1 ancount = 0 nscount = 2 arcount = 0
;; QUESTION SECTION (1 record)
;; 00800inkjets.se. IN NS
;; ANSWER SECTION (0 records)
;; AUTHORITY SECTION (2 records)
00800inkjets.se. 3600 IN NS ns1.eurodns.com.
00800inkjets.se. 3600 IN NS ns2.eurodns.com.
;; ADDITIONAL SECTION (0 records)
Query failed?! at ./nsec.pl line 11.