diff options
| author | Bob Halley <halley@nominum.com> | 2011-05-03 11:19:39 +0100 |
|---|---|---|
| committer | Bob Halley <halley@nominum.com> | 2011-05-03 11:19:39 +0100 |
| commit | 84f00f728f0fe25d3c0d99187cadd5391ebee04a (patch) | |
| tree | c94e9d7db45550c6cef55c2e343dfcd7c71127d8 /examples | |
| parent | 7ce8f56d867812edac74d09208616801864b86d4 (diff) | |
| download | dnspython-84f00f728f0fe25d3c0d99187cadd5391ebee04a.tar.gz | |
find the dnspython.org master server and query it
Diffstat (limited to 'examples')
| -rwxr-xr-x | examples/xfr.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/xfr.py b/examples/xfr.py index 669c6d1..1cd8404 100755 --- a/examples/xfr.py +++ b/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('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)) |
