]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
find the dnspython.org master server and query it
authorBob Halley <halley@nominum.com>
Tue, 3 May 2011 10:19:39 +0000 (11:19 +0100)
committerBob Halley <halley@nominum.com>
Tue, 3 May 2011 10:19:39 +0000 (11:19 +0100)
examples/xfr.py

index 669c6d137c2ddbc21fed6432dd45ff3fc18ffb55..1cd8404228063e78953ae48f9661ed86b91b943f 100755 (executable)
@@ -1,9 +1,13 @@
 #!/usr/bin/env python
 
 import dns.query
+import dns.resolver
 import dns.zone
 
-z = dns.zone.from_xfr(dns.query.xfr('78.32.75.15', 'dnspython.org'))
+soa_answer = dns.resolver.query('dnspython.org', 'SOA')
+master_answer = dns.resolver.query(soa_answer[0].mname, 'A')
+
+z = dns.zone.from_xfr(dns.query.xfr(master_answer[0].address, 'dnspython.org'))
 names = sorted(z)
 for n in names:
         print(z[n].to_text(n))