2010-10-31 Bob Halley <halley@dnspython.org>
+ * dns/resolver.py (zone_for_name): A query name resulting in a
+ CNAME or DNAME response to a node which had an SOA was incorrectly
+ treated as a zone origin. In these cases, we should just look
+ higher.
+
* Added zonediff.py to examples. This program compares two zones
and shows the differences either in diff-like plain text, or
HTML. Thanks to Dennis Kaarsemaker for contributing this
while 1:
try:
answer = resolver.query(name, dns.rdatatype.SOA, rdclass, tcp)
- return name
+ if answer.rrset.name == name:
+ return name
+ # otherwise we were CNAMEd or DNAMEd and need to look higher
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer):
- try:
- name = name.parent()
- except dns.name.NoParent:
- raise NoRootSOA
+ pass
+ try:
+ name = name.parent()
+ except dns.name.NoParent:
+ raise NoRootSOA