1
Release 2.3 Mon May 6 16:18:02 EST 2002
3
This is a another release of the pydns code, as originally written by
4
Guido van Rossum, and with a hopefully nicer API bolted over the
5
top of it by Anthony Baxter <anthony@interlink.com.au>.
7
This code is released under a Python-style license.
9
I'm making this release because there hasn't been a release in a
10
heck of a long time, and it probably deserves one. I'd also like to
11
do a substantial refactor of some of the guts of the code, and this
12
is likely to break any code that uses the existing interface. So
13
this will be a release for people who are using the existing API...
15
There are several known bugs/unfinished bits
17
- processing of AXFR results is not done yet.
18
- doesn't do IPv6 DNS requests (type AAAA)
19
- docs, aside from this file
20
- all sorts of other stuff that I've probably forgotten.
21
- MacOS support for discovering nameservers
22
- the API that I evolved some time ago is pretty ugly. I'm going
23
to re-do it, designed this time.
26
- processes /etc/resolv.conf - at least as far as nameserver directives go.
27
- tries multiple nameservers.
28
- nicer API - see below.
29
- returns results in more useful format.
30
- optional timing of requests.
31
- default 'show' behaviour emulates 'dig' pretty closely.
37
reqobj=DNS.Request(args)
40
args can be a name, in which case it takes that as the query, and/or a series
41
of keyword/value args. (see below for a list of args)
43
when calling the 'req()' method, it reuses the options specified in the
44
DNS.Request() call as defaults.
46
options are applied in the following order:
47
those specified in the req() call
48
or, if not specified there,
49
those specified in the creation of the Request() object
50
or, if not specified there,
51
those specified in the DNS.defaults dictionary
53
name servers can be specified in the following ways:
54
- by calling DNS.DiscoverNameServers(), which will load the DNS servers
55
from the system's /etc/resolv.conf file on Unix, or from the Registry
57
- by specifying it as an option to the request
58
- by manually setting DNS.defaults['server'] to a list of server IP
60
- XXXX It should be possible to load the DNS servers on a mac os machine,
61
from where-ever they've squirrelled them away
63
name="host.do.main" # the object being looked up
64
qtype="SOA" # the query type, eg SOA, A, MX, CNAME, ANY
65
protocol="udp" # "udp" or "tcp" - usually you want "udp"
66
server="nameserver" # the name of the nameserver. Note that you might
67
# want to use an IP address here
68
rd=1 # "recursion desired" - defaults to 1.
69
other: opcode, port, ...
71
There's also some convenience functions, for the lazy:
73
to do a reverse lookup:
74
>>> print DNS.revlookup("192.189.54.17")
75
yarrina.connect.com.au
77
to look up all MX records for an entry:
78
>>> print DNS.mxlookup("connect.com.au")
79
[(10, 'yarrina.connect.com.au'), (100, 'warrane.connect.com.au')]
81
Documentation of the rest of the interface will have to wait for a
82
later date. Note that the DnsAsyncRequest stuff is currently not
83
working - I haven't looked too closely at why, yet.
85
There's some examples in the tests/ directory - including test5.py,
86
which is even vaguely useful. It looks for the SOA for a domain, checks
87
that the primary NS is authoritative, then checks the nameservers
88
that it believes are NSs for the domain and checks that they're
89
authoritative, and that the zone serial numbers match.
91
see also README.guido for the original docs.
93
comments to me, anthony@interlink.com.au, or to the mailing list,
94
pydns-developer@lists.sourceforge.net.
96
bugs/patches to the tracker on SF -
97
http://sourceforge.net/tracker/?group_id=31674