Permalink
Browse files

compute dnspython.org master server and xfr from it

  • Loading branch information...
1 parent e09149d commit 2a44fece55034369d8e85aac67957546ec3eeaf4 Bob Halley committed May 3, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 examples/xfr.py
View
6 examples/xfr.py
@@ -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('204.152.189.147', '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 = z.nodes.keys()
names.sort()
for n in names:

0 comments on commit 2a44fec

Please sign in to comment.