• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

dns/H07-May-2022-15,79111,050

dnspython.egg-info/H03-May-2022-3836

examples/H03-May-2022-542368

tests/H03-May-2022-5,4084,211

LICENSEH A D01-Dec-20181.5 KiB3627

MANIFEST.inH A D15-Nov-2016133 43

PKG-INFOH A D08-Dec-20181.7 KiB3836

README.mdH A D08-Dec-201820.3 KiB666407

setup.cfgH A D08-Dec-2018102 117

setup.pyH A D01-Dec-20183.3 KiB8560

README.md

1# dnspython
2
3[![Build Status](https://travis-ci.org/rthalley/dnspython.svg?branch=master)](https://travis-ci.org/rthalley/dnspython)
4
5## INTRODUCTION
6
7dnspython is a DNS toolkit for Python. It supports almost all record types. It
8can be used for queries, zone transfers, and dynamic updates. It supports TSIG
9authenticated messages and EDNS0.
10
11dnspython provides both high and low level access to DNS. The high level classes
12perform queries for data of a given name, type, and class, and return an answer
13set. The low level classes allow direct manipulation of DNS zones, messages,
14names, and records.
15
16To see a few of the ways dnspython can be used, look in the `examples/` directory.
17
18dnspython is a utility to work with DNS, `/etc/hosts` is thus not used. For
19simple forward DNS lookups, it's better to use `socket.gethostbyname()`.
20
21dnspython originated at Nominum where it was developed
22to facilitate the testing of DNS software.
23
24## INSTALLATION
25
26* Many distributions have dnspython packaged for you, so you should
27  check there first.
28* If you have pip installed, you can do `pip install dnspython`
29* If not just download the source file and unzip it, then run
30  `sudo python setup.py install`
31
32## ABOUT THIS RELEASE
33
34This is dnspython 1.16.0
35
36### Notices
37
38Python 2.x support ends with the release of 1.16.0, unless there are
39critical bugs in 1.16.0.  Future versions of dnspython will only
40support Python 3.
41
42Version numbering of future dnspython releases will also start at 2.0, as
43incompatible changes will be permitted.  We're not planning huge changes at
44this time, but we'd like to do a better job at IDNA, and there are other
45API improvements to be made.
46
47The ChangeLog has been discontinued.  Please see the git history for detailed
48change information.
49
50### New since 1.15.0:
51
52* Much of the internals of dns.query.udp() and dns.query.tcp() have
53  been factored out into dns.query.send_udp(),
54  dns.query.receive_udp(), dns.query.send_tcp(), and
55  dns.query.receive_tcp().  Applications which want more control over
56  the socket may find the new routines helpful; for example it would
57  be easy to send multiple queries over a single TCP connection.
58
59* The OPENPGPKEY RR, and the CHAOS class A RR are now supported.
60
61* EDNS0 client-subnet is supported.
62
63* dns.resover.query() now has a lifetime timeout optional parameter.
64
65* pycryptodome and pycryptodomex are now supported and recommended for use
66  instead of pycrypto.
67
68* dns.message.from_wire() now has an ignore_trailing option.
69
70* type signatures have been provided.
71
72* module dns.hash is now deprecated, use standard Python libraries instead.
73
74* setup.py supports Cythonization to improve performance.
75
76### Bugs fixed since 1.15.0:
77
78* DNSSEC signature validation didn't check names correctly.  [Issue #295]
79
80* The NXDOMAIN exception should not use its docstring.  [Issue #253]
81
82* Fixed regression where trailing zeros in APL RRs were not
83  suppressed, and then fixed the problem where trailing zeros
84  were not added back properly on python 3 when needed.
85
86* Masterfile TTL defaulting is now harmonized with BIND practice.
87
88* dns.query.xfr() now raises on a non-zero rcode.
89
90* Rdata module importing is now locked to avoid races.
91
92* Several Python 3 incompatibilities have been fixed.
93
94* NSEC3 bitmap parsing now works with mulitple NSEC3 windows.
95
96* dns.renderer.Render supports TSIG on DNS envelope sequences.
97
98* DNSSEC validation now checks names properly [Issue #295]
99
100### New since 1.14.0:
101
102* IDNA 2008 support is now available if the "idna" module has been
103  installed and IDNA 2008 is requested.  The default IDNA behavior is
104  still IDNA 2003.  The new IDNA codec mechanism is currently only
105  useful for direct calls to dns.name.from_text() or
106  dns.name.from_unicode(), but in future releases it will be deployed
107  throughout dnspython, e.g. so that you can read a masterfile with an
108  IDNA 2008 codec in force.
109
110* By default, dns.name.to_unicode() is not strict about which
111  version of IDNA the input complies with.  Strictness can be
112  requested by using one of the strict IDNA codecs.
113
114* The AVC RR is now supported.
115
116### Bugs fixed since 1.14.0:
117
118* Some problems with newlines in various output modes have been
119  addressed.
120
121* dns.name.to_text() now returns text and not bytes on Python 3.x
122
123* Miscellaneous fixes for the Python 2/3 codeline merge.
124
125* Many "lint" fixes after the addition of pylint support.
126
127* The random number generator reseeds after a fork().
128
129
130## REQUIREMENTS
131
132Python 2.7 or 3.4+.
133
134
135## HOME PAGE
136
137For the latest in releases, documentation, and information, visit the dnspython
138home page at http://www.dnspython.org/
139
140
141## BUG REPORTS
142
143Bug reports may be opened at
144https://github.com/rthalley/dnspython/issues or sent to
145bugs@dnspython.org
146
147
148## MAILING LISTS
149
150A number of mailing lists are available. Visit the dnspython home page to
151subscribe or unsubscribe.
152
153
154## PRIOR RELEASE INFORMATION
155
156### New since 1.13.0:
157
158* CSYNC RRs are now supported.
159
160* `dns/message.py` (`make_query`): Setting any value which implies EDNS will
161  turn on EDNS if `use_edns` has not been specified.
162
163### Bugs fixed since 1.13.0:
164
165* TSIG signature algorithm setting was broken by the Python 2 and Python 3 code
166  line merge.
167
168* A bug in the LOC RR destroyed N/S and E/W distinctions within a degree of the
169  equator or prime merdian respectively.
170
171* Misc. fixes to deal with fallout from the Python 2 & 3 merge.
172  Fixes #156, #157, #158, #159, #160.
173
174* Running with python optimization on caused issues when stripped docstrings
175  were referenced. Fixes #154
176
177* `dns.zone.from_text()` erroneously required the zone to be provided.
178  Fixes #153
179
180### New since 1.12.0:
181
182* Dnspython now uses a single source for Python 2 and Python 3, eliminating the
183  painful merging between the Python 2 and Python 3 branches. Thank you so much
184  to Arthur Gautier for taking on this challenge and making it work! It was a
185  big job!
186
187* Support for Python older than 2.6 dropped.
188
189* Support for Python older than 3.3 dropped.
190
191* Zone origin can be specified as a string.
192
193* A rich string representation for all DNSExceptions.
194
195* setuptools has replaced distutils
196
197* Added support for CAA, CDS, CDNSKEY, EUI48, EUI64, and URI RR types.
198
199* Names now support the pickle protocol.
200
201* Ports can be specified per-nameserver in the stub resolver.
202
203### Bugs fixed since 1.12.0:
204
205* A number of Unicode name bugs have been fixed.
206
207* `resolv.conf` processing now rejects lines with too few tokens.
208
209* NameDicts now keep the max-depth value correct, and update properly.
210
211### New since 1.11.1:
212
213* Added `dns.zone.to_text()`.
214
215* Added support for "options rotate" in `/etc/resolv.conf`.
216
217* `dns.rdtypes.ANY.DNSKEY` now has helpers functions to convert between the
218  numeric form of the flags and a set of human-friendly strings
219
220* The reverse name of an IPv6 mapped IPv4 address is now in the IPv4 reverse
221  namespace.
222
223* The test system can now run the tests without requiring dnspython to be
224  installed.
225
226* Preliminary Elliptic Curve DNSSEC Validation (requires ecdsa module)
227
228### Bugs fixed since 1.11.1:
229
230* dnspython raised an exception when reading a masterfile starting with leading
231  whitespace
232
233* dnspython was affected by a python slicing API bug present on 64-bit windows.
234
235* Unicode escaping was applied at the wrong time.
236
237* RRSIG `to_text()` did not respect the relativize setting.
238
239* APL RRs with zero rdlength were rejected.
240
241* The tokenizer could put back an unescaped token.
242
243* Making a response to a message signed with TSIG was broken.
244
245* The IXFR state machine didn't handle long IXFR diffs.
246
247### New since 1.11.0:
248
249* Nothing
250
251### Bugs fixed since 1.11.0:
252
253* `dns.resolver.Resolver` erroneously referred to `retry_servfail`
254  instead of `self.retry_servfail`.
255
256* `dns.tsigkeyring.to_text()` would fail trying to convert the keyname to text.
257
258* Multi-message TSIGs were broken for algorithms other than HMAC-MD5 because we
259  weren't passing the right digest module to the HMAC code.
260
261* `dns.dnssec._find_candidate_keys()` tried to extract the key from the wrong
262  variable name.
263
264* $GENERATE tests were not backward compatible with python 2.4.
265
266### New since 1.10.0:
267
268* $GENERATE support
269
270* TLSA RR support
271
272* Added set_flags() method to dns.resolver.Resolver
273
274### Bugs fixed since 1.10.0:
275
276* Names with offsets >= 2^14 are no longer added to the compression table.
277
278* The "::" syntax is not used to shorten a single 16-bit section of the text
279  form an IPv6 address.
280
281* Caches are now locked.
282
283* YXDOMAIN is raised if seen by the resolver.
284
285* Empty rdatasets are not printed.
286
287* DNSKEY key tags are no longer assumed to be unique.
288
289### New since 1.9.4:
290
291* Added dns.resolver.LRUCache. In this cache implementation, the cache size is
292  limited to a user-specified number of nodes, and when adding a new node to a
293  full cache the least-recently used node is removed. If you're crawling the web
294  or otherwise doing lots of resolutions and you are using a cache, switching
295  to the LRUCache is recommended.
296
297* `dns.resolver.query()` will try TCP if a UDP response is truncated.
298
299* The python socket module's DNS methods can be now be overridden with
300  implementations that use dnspython's resolver.
301
302* Old DNSSEC types KEY, NXT, and SIG have been removed.
303
304* Whitespace is allowed in SSHFP fingerprints.
305
306* Origin checking in `dns.zone.from_xfr()` can be disabled.
307
308* Trailing junk checking can be disabled.
309
310* A source port can be specified when creating a resolver query.
311
312* All EDNS values may now be specified to `dns.message.make_query()`.
313
314### Bugs fixed since 1.9.4:
315
316* IPv4 and IPv6 address processing is now stricter.
317
318* Bounds checking of slices in rdata wire processing is now more strict, and
319  bounds errors (e.g. we got less data than was expected) now raise
320  `dns.exception.FormError` rather than `IndexError`.
321
322* Specifying a source port without specifying source used to have no effect, but
323  now uses the wildcard address and the specified port.
324
325### New since 1.9.3:
326
327* Nothing.
328
329### Bugs fixed since 1.9.3:
330
331* The rdata `_wire_cmp()` routine now handles relative names.
332
333* The SIG RR implementation was missing `import struct`.
334
335### New since 1.9.2:
336
337* A boolean parameter, `raise_on_no_answer`, has been added to the `query()`
338  methods. In no-error, no-data situations, this parameter determines whether
339  `NoAnswer` should be raised or not. If True, `NoAnswer` is raised. If False,
340  then an `Answer()` object with a None rrset will be returned.
341
342* Resolver `Answer()` objects now have a canonical_name field.
343
344* Rdata now has a `__hash__` method.
345
346### Bugs fixed since 1.9.2:
347
348* Dnspython was erroneously doing case-insensitive comparisons of the names in
349  NSEC and RRSIG RRs.
350
351* We now use `is` and not `==` when testing what section an RR is in.
352
353* The resolver now disallows metaqueries.
354
355### New since 1.9.1:
356
357* Nothing.
358
359### Bugs fixed since 1.9.1:
360
361* The `dns.dnssec` module didn't work at all due to missing imports that escaped
362  detection in testing because the test suite also did the imports. The third
363  time is the charm!
364
365### New since 1.9.0:
366
367* Nothing.
368
369### Bugs fixed since 1.9.0:
370
371* The `dns.dnssec` module didn't work with DSA due to namespace contamination
372  from a "from"-style import.
373
374### New since 1.8.0:
375
376* dnspython now uses `poll()` instead of `select()` when available.
377
378* Basic DNSSEC validation can be done using `dns.dnsec.validate()` and
379  `dns.dnssec.validate_rrsig()` if you have PyCrypto 2.3 or later installed.
380  Complete secure resolution is not yet available.
381
382* Added `key_id()` to the DNSSEC module, which computes the DNSSEC key id of a
383  DNSKEY rdata.
384
385* Added `make_ds()` to the DNSSEC module, which returns the DS RR for a given
386  DNSKEY rdata.
387
388* dnspython now raises an exception if HMAC-SHA284 or HMAC-SHA512 are used with
389  a Python older than 2.5.2. (Older Pythons do not compute the correct value.)
390
391* Symbolic constants are now available for TSIG algorithm names.
392
393### Bugs fixed since 1.8.0
394
395* `dns.resolver.zone_for_name()` didn't handle a query response with a CNAME or
396  DNAME correctly in some cases.
397
398* When specifying rdata types and classes as text, Unicode strings may now be
399  used.
400
401* Hashlib compatibility issues have been fixed.
402
403* `dns.message` now imports `dns.edns`.
404
405* The TSIG algorithm value was passed incorrectly to `use_tsig()` in some cases.
406
407### New since 1.7.1:
408
409* Support for hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384 and hmac-sha512
410  has been contributed by Kevin Chen.
411
412* The tokenizer's tokens are now Token objects instead of (type, value) tuples.
413
414### Bugs fixed since 1.7.1:
415
416* Escapes in masterfiles now work correctly. Previously they were only working
417  correctly when the text involved was part of a domain name.
418
419* When constructing a DDNS update, if the `present()` method was used with a
420  single rdata, a zero TTL was not added.
421
422* The entropy pool needed locking to be thread safe.
423
424* The entropy pool's reading of `/dev/random` could cause dnspython to block.
425
426* The entropy pool did buffered reads, potentially consuming more randomness
427  than we needed.
428
429* The entropy pool did not seed with high quality randomness on Windows.
430
431* SRV records were compared incorrectly.
432
433* In the e164 query function, the resolver parameter was not used.
434
435### New since 1.7.0:
436
437* Nothing
438
439### Bugs fixed since 1.7.0:
440
441* The 1.7.0 kitting process inadvertently omitted the code for the DLV RR.
442
443* Negative DDNS prerequisites are now handled correctly.
444
445### New since 1.6.0:
446
447* Rdatas now have a `to_digestable()` method, which returns the DNSSEC canonical
448  form of the rdata, suitable for use in signature computations.
449
450* The NSEC3, NSEC3PARAM, DLV, and HIP RR types are now supported.
451
452* An entropy module has been added and is used to randomize query ids.
453
454* EDNS0 options are now supported.
455
456* UDP IXFR is now supported.
457
458* The wire format parser now has a `one_rr_per_rrset` mode, which suppresses the
459  usual coalescing of all RRs of a given type into a single RRset.
460
461* Various helpful DNSSEC-related constants are now defined.
462
463* The resolver's `query()` method now has an optional `source` parameter,
464  allowing the source IP address to be specified.
465
466### Bugs fixed since 1.6.0:
467
468* On Windows, the resolver set the domain incorrectly.
469
470* DS RR parsing only allowed one Base64 chunk.
471
472* TSIG validation didn't always use absolute names.
473
474* `NSEC.to_text()` only printed the last window.
475
476* We did not canonicalize IPv6 addresses before comparing them; we
477  would thus treat equivalent but different textual forms, e.g.
478  "1:00::1" and "1::1" as being non-equivalent.
479
480* If the peer set a TSIG error, we didn't raise an exception.
481
482* Some EDNS bugs in the message code have been fixed (see the ChangeLog
483  for details).
484
485### New since 1.5.0:
486
487* Added dns.inet.is_multicast().
488
489### Bugs fixed since 1.5.0:
490
491* If `select()` raises an exception due to EINTR, we should just `select()`
492  again.
493
494* If the queried address is a multicast address, then don't check that the
495  address of the response is the same as the address queried.
496
497* NAPTR comparisons didn't compare the preference field due to a typo.
498
499* Testing of whether a Windows NIC is enabled now works on Vista thanks to code
500  contributed by Paul Marks.
501
502### New since 1.4.0:
503
504* Answer objects now support more of the python sequence protocol, forwarding
505  the requests to the answer rrset. E.g. `for a in answer` is equivalent to
506  `for a in  answer.rrset`, `answer[i]` is equivalent to `answer.rrset[i]`, and
507  `answer[i:j]` is equivalent to `answer.rrset[i:j]`.
508
509* Making requests using EDNS, including indicating DNSSEC awareness,
510  is now easier. For example, you can now say:
511  `q = dns.message.make_query('www.dnspython.org', 'MX', want_dnssec=True)`
512
513* `dns.query.xfr()` can now be used for IXFR.
514
515* Support has been added for the DHCID, IPSECKEY, and SPF RR types.
516
517* UDP messages from unexpected sources can now be ignored by setting
518  `ignore_unexpected` to True when calling `dns.query.udp`.
519
520### Bugs fixed since 1.4.0:
521
522* If `/etc/resolv.conf` didn't exist, we raised an exception instead of simply
523  using the default resolver configuration.
524
525* In `dns.resolver.Resolver._config_win32_fromkey()`, we were passing the wrong
526  variable to `self._config_win32_search()`.
527
528### New since 1.3.5:
529
530* You can now convert E.164 numbers to/from their ENUM name forms:
531  ```python
532  >>> import dns.e164
533  >>> n = dns.e164.from_e164("+1 555 1212")
534  >>> n
535  <DNS name 2.1.2.1.5.5.5.1.e164.arpa.>
536  >>> dns.e164.to_e164(n)
537  '+15551212'
538  ```
539
540* You can now convert IPv4 and IPv6 address to/from their corresponding DNS
541  reverse map names:
542  ```python
543  >>> import dns.reversename
544  >>> n = dns.reversename.from_address("127.0.0.1")
545  >>> n
546  <DNS name 1.0.0.127.in-addr.arpa.>
547  >>> dns.reversename.to_address(n)
548  '127.0.0.1'
549  ```
550
551* You can now convert between Unicode strings and their IDN ACE form:
552  ```python
553  >>> n = dns.name.from_text(u'les-\u00e9l\u00e8ves.example.')
554  >>> n
555  <DNS name xn--les-lves-50ai.example.>
556  >>> n.to_unicode()
557  u'les-\xe9l\xe8ves.example.'
558  ```
559
560* The origin parameter to `dns.zone.from_text()` and `dns.zone.to_text()` is now
561  optional. If not specified, the origin will be taken from the first $ORIGIN
562  statement in the master file.
563
564* Sanity checking of a zone can be disabled; this is useful when working with
565  files which are zone fragments.
566
567### Bugs fixed since 1.3.5:
568
569* The correct delimiter was not used when retrieving the list of nameservers
570  from the registry in certain versions of windows.
571
572* The floating-point version of latitude and longitude in LOC RRs
573  (`float_latitude` and `float_longitude`) had incorrect signs for south
574  latitudes and west longitudes.
575
576* BIND 8 TTL syntax is now accepted in all TTL-like places (i.e. SOA fields
577  refresh, retry, expire, and minimum; SIG/RRSIG field original_ttl).
578
579* TTLs are now bounds checked when their text form is parsed, and their values
580  must be in the closed interval `[0, 2^31 - 1]`.
581
582### New since 1.3.4:
583
584* In the resolver, if time goes backward a little bit, ignore it.
585
586* `zone_for_name()` has been added to the resolver module. It returns the zone
587  which is authoritative for the specified name, which is handy for dynamic
588  update. E.g.
589
590      import dns.resolver
591      print dns.resolver.zone_for_name('www.dnspython.org')
592
593  will output `"dnspython.org."` and
594  `print dns.resolver.zone_for_name('a.b.c.d.e.f.example.')`
595  will output `"."`.
596
597* The default resolver can be fetched with the `get_default_resolver()` method.
598
599* You can now get the parent (immediate superdomain) of a name by using the
600  `parent()` method.
601
602* `Zone.iterate_rdatasets()` and `Zone.iterate_rdatas()` now have a default
603  rdtype of `dns.rdatatype.ANY` like the documentation says.
604
605* A Dynamic DNS example, ddns.py, has been added.
606
607### New since 1.3.3:
608
609* The source address and port may now be specified when calling
610  `dns.query.{udp,tcp,xfr}`.
611
612* The resolver now does exponential backoff each time it runs through all of the
613  nameservers.
614
615* Rcodes which indicate a nameserver is likely to be a "permanent failure" for a
616  query cause the nameserver to be removed from the mix for that query.
617
618### New since 1.3.2:
619
620* `dns.message.Message.find_rrset()` now uses an index, vastly improving the
621  `from_wire()` performance of large messages such as zone transfers.
622
623* Added `dns.message.make_response()`, which creates a skeletal response for the
624  specified query.
625
626* Added `opcode()` and `set_opcode()` convenience methods to the
627  `dns.message.Message` class. Added the `request_payload` attribute to the
628  Message class.
629
630* The `file` parameter of `dns.name.Name.to_wire()` is now optional; if omitted,
631  the wire form will be returned as the value of the function.
632
633* `dns.zone.from_xfr()` in relativization mode incorrectly set `zone.origin` to
634  the empty name.
635
636* The masterfile parser incorrectly rejected TXT records where a value was not
637  quoted.
638
639### New since 1.3.1:
640
641* The NSEC format doesn't allow specifying types by number, so we shouldn't
642  either. (Using the unknown type format is still OK though.)
643
644* The resolver wasn't catching `dns.exception.Timeout`, so a timeout erroneously
645  caused the whole resolution to fail instead of just going on to the next
646  server.
647
648* The renderer module didn't import random, causing an exception to be raised if
649  a query id wasn't provided when a Renderer was created.
650
651* The conversion of LOC milliseconds values from text to binary was incorrect if
652  the length of the milliseconds string was not 3.
653
654### New since 1.3.0:
655
656* Added support for the SSHFP type.
657
658### New since 1.2.0:
659
660* Added support for new DNSSEC types RRSIG, NSEC, and DNSKEY.
661
662* This release fixes all known bugs.
663
664* See the ChangeLog file for more detailed information on changes since the
665  prior release.
666