Name | py3dns JSON |
Version |
4.0.2
JSON |
| download |
home_page | None |
Summary | Python 3 DNS library |
upload_time | 2024-06-06 12:17:08 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.2 |
license | None |
keywords |
dns
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Release 4.0.0 Sat, Jul 1, 2023
Removed class DnsAsyncRequest since Python 3.12 dropped asyncore. Bumping
major version since this is a breaking change. If you need async DNS, use
aiodns instead.
Changed behavior when /etc/resolv.conf is missing. Instead of
FileNotFoundError, assume DNS server is '127.0.0.1'.
Release 3.2.0 Mon Jul 23 2018
Switched from distutils to setuptools because "it's the future". It is
unlikely to have end user impact. For python3.3+ no additional dependencies
are required.
Release 3.1.0 Thu Apr 24 23:52:00 EDT 2014
More choices about result types are provided in 3.1.0. To specify resulttype,
in a DnsRequest object, use the new function DnsRequest.qry
(resulttype='binary/text/default'). DnsRequest.qry returns ipaddress objects
for A and AAAA queries by defaults. Other defaults are the same as
DnsRequest.req. Continue to use DnsRequest.req for exact backward
compatibility with pydns and older py3dns defaults. TXT and SPF record data
are returned as strings by default, this matches what dnspython3 returns.
The ipaddress module is used internally now. See CHANGES for details.
Release 3.0.3 Wed May 29 00:05:00 EDT 2013
There was a third, unintended incompatiblity in 3.0.2 in that IPv6 addresses
were returned in their string format rather than their decimal format. This
breaks pyspf queries when the connect IP is IPv6. 3.0.3 is a release strictly
to revert this change.
Release 3.0.2 Thu Jan 19 01:25:00 EST 2012
This release introduces two potentially incompatible changes from the python
verion of DNS (pydns). First, the data portion of DNS records of types TXT
and SPF are returned as bytes instead of strings. Second, additional sub
classes of DNSError have been added. Any code that catches DNSError should
be checked to see if it needs updating to catch one of the new sub classes:
ArgumentError, SocketError, TimeoutError, ServerError, and
IncompleteReplyError.
Release 3.0 Sun Mar 2-9 23:07:22 2011 -0400
Ported to Python3 by Scott Kitterman <scott@kitterman.com>. This is mostly a
minimal port to work with Python3 (tested with python3.2) plus addition of
some of the patches that people have submitted on Sourceforge. It should be
fully API compatible with 2.3. Note: Version 3.0.0 shipped with a new
lazy.lookupfull function in advance of 2.3. This was incorporated in pydns
2.3.5 as lazy.lookupalll. It has been renamed in 3.0.1 to stay API compatible
with pydns 2.3.
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.
py3dns is derived from pydns. The sourceforge details below refer to pydns.
All py3dns issues/comments/etc should be reported via
https://launchpad.net/py3dns.
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
Raw data
{
"_id": null,
"home_page": null,
"name": "py3dns",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.2",
"maintainer_email": "Scott Kitterman <scott@kitterman.com>",
"keywords": "DNS",
"author": null,
"author_email": "Anthony Baxter and others <py3dns-hackers@lists.launchpad.net>",
"download_url": "https://files.pythonhosted.org/packages/76/67/d7e745a5248bd7ecf2b76d3a1c8280255cbbdcb21174b171cf3c87740836/py3dns-4.0.2.tar.gz",
"platform": null,
"description": "Release 4.0.0 Sat, Jul 1, 2023\nRemoved class DnsAsyncRequest since Python 3.12 dropped asyncore. Bumping\nmajor version since this is a breaking change. If you need async DNS, use\naiodns instead.\n\nChanged behavior when /etc/resolv.conf is missing. Instead of\nFileNotFoundError, assume DNS server is '127.0.0.1'.\n\nRelease 3.2.0 Mon Jul 23 2018\n\nSwitched from distutils to setuptools because \"it's the future\". It is\nunlikely to have end user impact. For python3.3+ no additional dependencies\nare required.\n\nRelease 3.1.0 Thu Apr 24 23:52:00 EDT 2014\n\nMore choices about result types are provided in 3.1.0. To specify resulttype,\nin a DnsRequest object, use the new function DnsRequest.qry\n(resulttype='binary/text/default'). DnsRequest.qry returns ipaddress objects\nfor A and AAAA queries by defaults. Other defaults are the same as\nDnsRequest.req. Continue to use DnsRequest.req for exact backward\ncompatibility with pydns and older py3dns defaults. TXT and SPF record data\nare returned as strings by default, this matches what dnspython3 returns.\n\nThe ipaddress module is used internally now. See CHANGES for details.\n\nRelease 3.0.3 Wed May 29 00:05:00 EDT 2013\n\nThere was a third, unintended incompatiblity in 3.0.2 in that IPv6 addresses\nwere returned in their string format rather than their decimal format. This\nbreaks pyspf queries when the connect IP is IPv6. 3.0.3 is a release strictly\nto revert this change.\n\nRelease 3.0.2 Thu Jan 19 01:25:00 EST 2012\n\nThis release introduces two potentially incompatible changes from the python\nverion of DNS (pydns). First, the data portion of DNS records of types TXT\nand SPF are returned as bytes instead of strings. Second, additional sub\nclasses of DNSError have been added. Any code that catches DNSError should\nbe checked to see if it needs updating to catch one of the new sub classes:\nArgumentError, SocketError, TimeoutError, ServerError, and\nIncompleteReplyError.\n\nRelease 3.0 Sun Mar 2-9 23:07:22 2011 -0400\n\nPorted to Python3 by Scott Kitterman <scott@kitterman.com>. This is mostly a\nminimal port to work with Python3 (tested with python3.2) plus addition of\nsome of the patches that people have submitted on Sourceforge. It should be\nfully API compatible with 2.3. Note: Version 3.0.0 shipped with a new\nlazy.lookupfull function in advance of 2.3. This was incorporated in pydns\n2.3.5 as lazy.lookupalll. It has been renamed in 3.0.1 to stay API compatible\nwith pydns 2.3.\n\nRelease 2.3 Mon May 6 16:18:02 EST 2002\n\nThis is a another release of the pydns code, as originally written by \nGuido van Rossum, and with a hopefully nicer API bolted over the\ntop of it by Anthony Baxter <anthony@interlink.com.au>. \n\nThis code is released under a Python-style license. \n\nI'm making this release because there hasn't been a release in a \nheck of a long time, and it probably deserves one. I'd also like to\ndo a substantial refactor of some of the guts of the code, and this\nis likely to break any code that uses the existing interface. So\nthis will be a release for people who are using the existing API...\n\nThere are several known bugs/unfinished bits\n\n- processing of AXFR results is not done yet.\n- doesn't do IPv6 DNS requests (type AAAA) \n- docs, aside from this file\n- all sorts of other stuff that I've probably forgotten.\n- MacOS support for discovering nameservers\n- the API that I evolved some time ago is pretty ugly. I'm going\n to re-do it, designed this time.\n\nStuff it _does_ do:\n- processes /etc/resolv.conf - at least as far as nameserver directives go.\n- tries multiple nameservers.\n- nicer API - see below.\n- returns results in more useful format.\n- optional timing of requests.\n- default 'show' behaviour emulates 'dig' pretty closely.\n \n\nTo use:\n\nimport DNS\nreqobj=DNS.Request(args)\nreqobj.req(args)\n\nargs can be a name, in which case it takes that as the query, and/or a series\nof keyword/value args. (see below for a list of args)\n\nwhen calling the 'req()' method, it reuses the options specified in the\nDNS.Request() call as defaults.\n\noptions are applied in the following order:\n those specified in the req() call\n or, if not specified there,\n those specified in the creation of the Request() object\n or, if not specified there,\n those specified in the DNS.defaults dictionary\n\nname servers can be specified in the following ways:\n- by calling DNS.DiscoverNameServers(), which will load the DNS servers\n from the system's /etc/resolv.conf file on Unix, or from the Registry\n on windows.\n- by specifying it as an option to the request\n- by manually setting DNS.defaults['server'] to a list of server IP\n addresses to try\n- XXXX It should be possible to load the DNS servers on a mac os machine, \n from where-ever they've squirrelled them away\n\nname=\"host.do.main\" # the object being looked up\nqtype=\"SOA\" # the query type, eg SOA, A, MX, CNAME, ANY\nprotocol=\"udp\" # \"udp\" or \"tcp\" - usually you want \"udp\"\nserver=\"nameserver\" # the name of the nameserver. Note that you might\n # want to use an IP address here\nrd=1 # \"recursion desired\" - defaults to 1.\nother: opcode, port, ...\n\nThere's also some convenience functions, for the lazy:\n\nto do a reverse lookup:\n>>> print DNS.revlookup(\"192.189.54.17\") \nyarrina.connect.com.au\n\nto look up all MX records for an entry:\n>>> print DNS.mxlookup(\"connect.com.au\")\n[(10, 'yarrina.connect.com.au'), (100, 'warrane.connect.com.au')]\n\nDocumentation of the rest of the interface will have to wait for a \nlater date. Note that the DnsAsyncRequest stuff is currently not\nworking - I haven't looked too closely at why, yet.\n\nThere's some examples in the tests/ directory - including test5.py,\nwhich is even vaguely useful. It looks for the SOA for a domain, checks\nthat the primary NS is authoritative, then checks the nameservers\nthat it believes are NSs for the domain and checks that they're\nauthoritative, and that the zone serial numbers match.\n\nsee also README.guido for the original docs.\n\npy3dns is derived from pydns. The sourceforge details below refer to pydns.\nAll py3dns issues/comments/etc should be reported via\nhttps://launchpad.net/py3dns.\n\ncomments to me, anthony@interlink.com.au, or to the mailing list,\npydns-developer@lists.sourceforge.net.\n\nbugs/patches to the tracker on SF - \n http://sourceforge.net/tracker/?group_id=31674\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Python 3 DNS library",
"version": "4.0.2",
"project_urls": null,
"split_keywords": [
"dns"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b7431ff28f5302a0f423d4210cacc1f12fb416b6ba1f4c7107e020d264acb625",
"md5": "f3b1ade74dc733ad95dce6518ef566cb",
"sha256": "36bffe62b59a72cfa09c03f0bd3473e0126f20ee4285d14c07415dbf6f5fd571"
},
"downloads": -1,
"filename": "py3dns-4.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f3b1ade74dc733ad95dce6518ef566cb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.2",
"size": 29589,
"upload_time": "2024-06-06T12:17:06",
"upload_time_iso_8601": "2024-06-06T12:17:06.862353Z",
"url": "https://files.pythonhosted.org/packages/b7/43/1ff28f5302a0f423d4210cacc1f12fb416b6ba1f4c7107e020d264acb625/py3dns-4.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7667d7e745a5248bd7ecf2b76d3a1c8280255cbbdcb21174b171cf3c87740836",
"md5": "1623680ae77bd4723ed75996cb85c48e",
"sha256": "98652e80ecec143c60f78f0e6b341631ca9a7560edd8dddfc864c02902618a39"
},
"downloads": -1,
"filename": "py3dns-4.0.2.tar.gz",
"has_sig": false,
"md5_digest": "1623680ae77bd4723ed75996cb85c48e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.2",
"size": 33982,
"upload_time": "2024-06-06T12:17:08",
"upload_time_iso_8601": "2024-06-06T12:17:08.495702Z",
"url": "https://files.pythonhosted.org/packages/76/67/d7e745a5248bd7ecf2b76d3a1c8280255cbbdcb21174b171cf3c87740836/py3dns-4.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-06 12:17:08",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "py3dns"
}