Attempts to execute dns.resolver.query() using rdtype='ANY' will generate a NoAnswer exception even for queries which return an answer. See test case below.

dnspython==1.8.0

>>> import dns.resolver
>>> dns.resolver.query('www.dnspython.org', 'ANY')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
File "/Users/macarpen/Development/python/iptools/lib/python2.6/site-packages/dns/resolver.py", line 732, in query return get_default_resolver().query(qname, rdtype, rdclass, tcp, source) File "/Users/macarpen/Development/python/iptools/lib/python2.6/site-packages/dns/resolver.py", line 672, in query
    answer = Answer(qname, rdtype, rdclass, response)
File "/Users/macarpen/Development/python/iptools/lib/python2.6/site-packages/dns/resolver.py", line 121, in __init__
    raise NoAnswer
NoAnswer


$dig www.dnspython.org ANY

; <<>> DiG 9.6.0-APPLE-P2 <<>> www.dnspython.org ANY
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13461
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 6, ADDITIONAL: 12

;; QUESTION SECTION:
;www.dnspython.org.             IN      ANY

;; ANSWER SECTION:
www.dnspython.org.      1277    IN      CNAME   howl.dnspython.org.

;; AUTHORITY SECTION:
org.                    80288   IN      NS      b0.org.afilias-nst.org.
org.                    80288   IN      NS      b2.org.afilias-nst.org.
org.                    80288   IN      NS      c0.org.afilias-nst.info.
org.                    80288   IN      NS      d0.org.afilias-nst.org.
org.                    80288   IN      NS      a0.org.afilias-nst.info.
org.                    80288   IN      NS      a2.org.afilias-nst.info.

;; ADDITIONAL SECTION:
a0.org.afilias-nst.info. 72555  IN      A       199.19.56.1
a0.org.afilias-nst.info. 72618  IN      AAAA    2001:500:e::1
a2.org.afilias-nst.info. 31883  IN      A       199.249.112.1
a2.org.afilias-nst.info. 23986  IN      AAAA    2001:500:40::1
b0.org.afilias-nst.org. 775     IN      A       199.19.54.1
b0.org.afilias-nst.org. 794     IN      AAAA    2001:500:c::1
b2.org.afilias-nst.org. 73261   IN      A       199.249.120.1
b2.org.afilias-nst.org. 73270   IN      AAAA    2001:500:48::1
c0.org.afilias-nst.info. 72555  IN      A       199.19.53.1
c0.org.afilias-nst.info. 15361  IN      AAAA    2001:500:b::1
d0.org.afilias-nst.org. 20535   IN      A       199.19.57.1
d0.org.afilias-nst.org. 20652   IN      AAAA    2001:500:f::1

;; Query time: 21 msec
;; SERVER: -
;; WHEN: Fri Dec 10 15:46:27 2010
;; MSG SIZE  rcvd: 456


--
Michael Carpenter
_______________________________________________
dnspython-bugs mailing list
[email protected]
http://howl.play-bow.org/mailman/listinfo.cgi/dnspython-bugs

Reply via email to