Subject: | Problem with AUTHORITY records? |
Hi, I'm having trouble getting data out of an AUTHORITY section, when there is no ANSWER section. (And it seems that the arcount is the same as ancount, when there are ANSWER records.) Am I doing something wrong?
For example: I am querying a COM.AU DNS Server for centralkitchens.com.au, which gives me the following:
;; query(centralkitchens.com.au, NS, IN)
;; send_udp(210.8.15.253:53)
;; answer from 210.8.15.253:53 : 113 bytes
;; HEADER SECTION
;; id = 24503
;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 1
;; ra = 0 ad = 0 cd = 0 rcode = NOERROR
;; qdcount = 1 ancount = 0 nscount = 3 arcount = 0
;; QUESTION SECTION (1 record)
;; centralkitchens.com.au. IN NS
;; ANSWER SECTION (0 records)
;; AUTHORITY SECTION (3 records)
centralkitchens.com.au. 86400 IN NS lnk.maets.com.
centralkitchens.com.au. 86400 IN NS lnk.wurley.net.
centralkitchens.com.au. 86400 IN NS dsl.wurley.net.
;; ADDITIONAL SECTION (0 records)
My $query->header->arcount complains "Cant call method on undefined value." And $query->authority is undef.
If I query a root COM.AU server which returns the following result:
;; query(com.au, NS, IN)
;; send_udp(10.1.3.65:53)
;; answer from 10.1.3.65:53 : 357 bytes
;; HEADER SECTION
;; id = 23973
;; qr = 1 opcode = QUERY aa = 0 tc = 0 rd = 1
;; ra = 1 ad = 0 cd = 0 rcode = NOERROR
;; qdcount = 1 ancount = 8 nscount = 0 arcount = 8
;; QUESTION SECTION (1 record)
;; com.au. IN NS
;; ANSWER SECTION (8 records)
com.au. 69442 IN NS ns3.melbourneit.com.
com.au. 69442 IN NS ns4.ausregistry.net.
com.au. 69442 IN NS dns1.telstra.net.
com.au. 69442 IN NS dmssyd.nsw.cmis.csiro.au.
com.au. 69442 IN NS ns.ripe.net.
com.au. 69442 IN NS ns1.ausregistry.net.
com.au. 69442 IN NS ns2.ausregistry.net.
com.au. 69442 IN NS ns3.ausregistry.net.
;; AUTHORITY SECTION (0 records)
;; ADDITIONAL SECTION (8 records)
ns.ripe.net. 169647 IN A 193.0.0.193
ns1.ausregistry.net. 113504 IN A 203.18.56.41
ns2.ausregistry.net. 113504 IN A 203.18.56.42
ns3.ausregistry.net. 113504 IN A 203.18.56.43
ns3.melbourneit.com. 27105 IN A 203.27.227.10
ns4.ausregistry.net. 113504 IN A 210.8.15.253
dns1.telstra.net. 862 IN A 203.50.5.200
dmssyd.nsw.cmis.csiro.au. 243265 IN A 130.155.16.1
Then, header->arcount = 8 and header->ancount = 8 ??
Is the authority records and answer records being confused somewhere?
How can I find out the AUTHORITY results and there are no ANSWER results?
(I'm using this in my code:
foreach $rr ($gQuery->authority) {
print "Working AUTHORITY record [".$rr->type."] [".$rr->nsdname."]\n";
next unless $rr->type eq "NS";
push (@lResults, $rr->nsdname);
}
Which never prints anything.)