~ubuntu-branches/ubuntu/gutsy/python-dns/gutsy-security

« back to all changes in this revision

Viewing changes to README.txt

  • Committer: Bazaar Package Importer
  • Author(s): Joerg Wendland
  • Date: 2003-08-20 14:25:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20030820142529-3facqpkoslard81q
Tags: 2.3.0-5
* debian/control:
  Use ${python:Depends} for Depends, so that correct Depends are
  generated by dh_python. (closes: Bug#205884)
* debian/python-dns.postinst
  debian/python-dns.prerm:
  Remove these files and let debhelper handle these issues.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Release 2.3 Mon May  6 16:18:02 EST 2002
 
2
 
 
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>. 
 
6
 
 
7
This code is released under a Python-style license. 
 
8
 
 
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...
 
14
 
 
15
There are several known bugs/unfinished bits
 
16
 
 
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.
 
24
 
 
25
Stuff it _does_ do:
 
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.
 
32
  
 
33
 
 
34
To use:
 
35
 
 
36
import DNS
 
37
reqobj=DNS.Request(args)
 
38
reqobj.req(args)
 
39
 
 
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)
 
42
 
 
43
when calling the 'req()' method, it reuses the options specified in the
 
44
DNS.Request() call as defaults.
 
45
 
 
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
 
52
 
 
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
 
56
    on windows.
 
57
- by specifying it as an option to the request
 
58
- by manually setting DNS.defaults['server'] to a list of server IP
 
59
    addresses to try
 
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
 
62
 
 
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, ...
 
70
 
 
71
There's also some convenience functions, for the lazy:
 
72
 
 
73
to do a reverse lookup:
 
74
>>> print DNS.revlookup("192.189.54.17")    
 
75
yarrina.connect.com.au
 
76
 
 
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')]
 
80
 
 
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.
 
84
 
 
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.
 
90
 
 
91
see also README.guido for the original docs.
 
92
 
 
93
comments to me, anthony@interlink.com.au, or to the mailing list,
 
94
pydns-developer@lists.sourceforge.net.
 
95
 
 
96
bugs/patches to the tracker on SF - 
 
97
               http://sourceforge.net/tracker/?group_id=31674