[Twisted-Python] t.n.c.lookupAddress returns DNSNameError for hostnames w/ no A record

byr sa byrsa at sinkhole.me
Tue Apr 2 02:48:58 EDT 2013

Hi all,

I saw in previous posts that DNSNameError signifies an 'NXDOMAIN' status
and DNSServerError signifies 'SERVFAIL'. However, I am getting a
DNSNameError from twisted.names.client.lookupAddress() when I query a
hostname that has no A records, but *does have* other records (NS, SOA,

An example:

; <<>> DiG 9.8.3-P1 <<>> megaupload.com ANY
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19402
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;megaupload.com. IN ANY

megaupload.com. 21600 IN SOA ns5.cirfu.net. ipr.ic.fbi.gov. 2013022001 3600
900 604800 900
megaupload.com. 21600 IN NS ns5.cirfu.net.
megaupload.com. 21600 IN NS ns6.cirfu.net.

dig is telling me 'status: NOERROR'. Is there an easy way to determine the
status of a DNS query from a twisted.names.dns.Message ? I checked the
source and it wasn't readily apparent (to me). In my code I'm checking the
value of failure.value.__class__.__name__ to determine if an answer is NX
or SERVFAIL. Seems like there should be a better way... Here's the code if
anybody wants to take a look:


Thanks to the Twisted devs and maintainers for all your hard work!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20130401/13d189b1/attachment.htm 

More information about the Twisted-Python mailing list