Release 2.3 Mon May 6 16:18:02 EST 2002
This is a another release of the pydns code, as originally written by
Guido van Rossum, and with a hopefully nicer API bolted over the
top of it by Anthony Baxter <anthony@interlink.com.au>.
This code is released under a Python-style license.
I'm making this release because there hasn't been a release in a
heck of a long time, and it probably deserves one. I'd also like to
do a substantial refactor of some of the guts of the code, and this
is likely to break any code that uses the existing interface. So
this will be a release for people who are using the existing API...
There are several known bugs/unfinished bits
- processing of AXFR results is not done yet.
- doesn't do IPv6 DNS requests (type AAAA)
- docs, aside from this file
- all sorts of other stuff that I've probably forgotten.
- MacOS support for discovering nameservers
- the API that I evolved some time ago is pretty ugly. I'm going
to re-do it, designed this time.
Stuff it _does_ do:
- processes /etc/resolv.conf - at least as far as nameserver directives go.
- tries multiple nameservers.
- nicer API - see below.
- returns results in more useful format.
- optional timing of requests.
- default 'show' behaviour emulates 'dig' pretty closely.
To use:
import DNS
reqobj=DNS.Request(args)
reqobj.req(args)
args can be a name, in which case it takes that as the query, and/or a series
of keyword/value args. (see below for a list of args)
when calling the 'req()' method, it reuses the options specified in the
DNS.Request() call as defaults.
options are applied in the following order:
those specified in the req() call
or, if not specified there,
those specified in the creation of the Request() object
or, if not specified there,
those specified in the DNS.defaults dictionary
name servers can be specified in the following ways:
- by calling DNS.DiscoverNameServers(), which will load the DNS servers
from the system's /etc/resolv.conf file on Unix, or from the Registry
on windows.
- by specifying it as an option to the request
- by manually setting DNS.defaults['server'] to a list of server IP
addresses to try
- XXXX It should be possible to load the DNS servers on a mac os machine,
from where-ever they've squirrelled them away
name="host.do.main" # the object being looked up
qtype="SOA" # the query type, eg SOA, A, MX, CNAME, ANY
protocol="udp" # "udp" or "tcp" - usually you want "udp"
server="nameserver" # the name of the nameserver. Note that you might
# want to use an IP address here
rd=1 # "recursion desired" - defaults to 1.
other: opcode, port, ...
There's also some convenience functions, for the lazy:
to do a reverse lookup:
>>> print DNS.revlookup("192.189.54.17")
yarrina.connect.com.au
to look up all MX records for an entry:
>>> print DNS.mxlookup("connect.com.au")
[(10, 'yarrina.connect.com.au'), (100, 'warrane.connect.com.au')]
Documentation of the rest of the interface will have to wait for a
later date. Note that the DnsAsyncRequest stuff is currently not
working - I haven't looked too closely at why, yet.
There's some examples in the tests/ directory - including test5.py,
which is even vaguely useful. It looks for the SOA for a domain, checks
that the primary NS is authoritative, then checks the nameservers
that it believes are NSs for the domain and checks that they're
authoritative, and that the zone serial numbers match.
see also README.guido for the original docs.
comments to me, anthony@interlink.com.au, or to the mailing list,
pydns-developer@lists.sourceforge.net.
bugs/patches to the tracker on SF -
http://sourceforge.net/tracker/?group_id=31674
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
aquests-0.29.2.6.tar.gz (92个子文件)
aquests-0.29.2.6
PKG-INFO 1KB
README.rst 197B
aquests.egg-info
PKG-INFO 1KB
requires.txt 7B
SOURCES.txt 3KB
top_level.txt 8B
dependency_links.txt 1B
aquests
queue.py 987B
client
asynconnect.py 15KB
adns.py 3KB
__init__.py 217B
socketpool.py 7KB
synconnect.py 1KB
protocols
ws
tunnel_handler.py 1KB
producer.py 2KB
request.py 626B
__init__.py 260B
request_handler.py 6KB
response.py 750B
grpc
buffers.py 516B
message.py 549B
request.py 1KB
__init__.py 0B
discover.py 2KB
producers.py 2KB
dns
clients.py 4KB
pydns
README.txt 4KB
Opcode.py 1KB
README-guido.txt 524B
lazy.py 1KB
win32dns.py 4KB
__init__.py 2KB
Base.py 9KB
Type.py 2KB
Status.py 2KB
Class.py 1KB
Lib.py 19KB
__init__.py 10KB
README-hans.txt 740B
http
treebuilder.py 3KB
buffers.py 3KB
tunnel_handler.py 2KB
producer.py 3KB
request.py 9KB
http_auth.py 3KB
util.py 2KB
urlinfo.py 4KB
__init__.py 0B
http_util.py 4KB
request_handler.py 11KB
respcodes.py 2KB
response.py 10KB
localstorage.py 3KB
base_request_handler.py 358B
http_date.py 3KB
smtp
async_smtp.py 12KB
__init__.py 0B
composer.py 6KB
proxy
tunnel_handler.py 790B
__init__.py 0B
whois.py 1KB
__init__.py 0B
http2
fifo.py 2KB
__init__.py 108B
request_handler.py 9KB
producers.py 3KB
response_builder.py 326B
dbapi
dbpool.py 3KB
syndbi.py 4KB
synsqlite3.py 2KB
request.py 2KB
dbconnect.py 5KB
asynmongo.py 10KB
__init__.py 416B
asynredis.py 4KB
asynpsycopg2.py 5KB
tl.py 2KB
lib.py 239B
__init__.py 14KB
uninstalled.py 208B
athreads
select_trigger.py 6KB
fifo.py 3KB
__init__.py 0B
trigger.py 866B
socket_map.py 1KB
trigger_file.py 3KB
threadlib.py 3KB
lifetime.py 6KB
request_builder.py 2KB
stubproxy.py 628B
setup.cfg 63B
setup.py 3KB
共 92 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功