Codebase list dnspython / e97a7fb
Import dnspython_1.14.0.orig.tar.gz Scott Kitterman 7 years ago
30 changed file(s) with 998 addition(s) and 209 deletion(s). Raw diff Collapse all Expand all
0 2016-05-27 Bob Halley <halley@dnspython.org>
1
2 * (Version 1.14.0 released)
3
4 * Add CSYNC RR support
5
6 * Fix bug in LOC which destroyed N/S and E/W distinctions within
7 a degree of the equator or prime merdian respectively.
8
9 * Misc. fixes to deal with fallout from the Python 2 & 3 merge.
10 [issue #156], [issue #157], [issue #158], [issue #159],
11 [issue #160].
12
13 * Running with python optimization on caused issues when
14 stripped docstrings were referenced. [issue #154]
15
16 * dns.zone.from_text() erroneously required the zone to be provided.
17 [issue #153]
18
19 2016-05-13 Bob Halley <halley@dnspython.org>
20
21 * dns/message.py (make_query): Setting any value which implies
22 EDNS will turn on EDNS if 'use_edns' has not been specified.
23
24 2016-05-12 Bob Halley <halley@dnspython.org>
25
26 * TSIG signature algorithm setting was broken by the Python 2
27 and Python 3 code line merge. Fixed.
28
029 2016-05-10 Bob Halley <halley@dnspython.org>
130
231 * (Version 1.13.0 released)
3362
3463 * Comparing two rdata is now always done by comparing the binary
3564 data of the DNSSEC digestable forms. This corrects a number of
36 errors where dnspython's rdata comparsion order was not the
65 errors where dnspython's rdata comparison order was not the
3766 DNSSEC order.
3867
3968 * Add CAA implementation. Thanks to Brian Wellington for the
915944 2003-11-13 Bob Halley <halley@dnspython.org>
916945
917946 * dns/rdtypes/ANY/LOC.py (LOC.to_wire): We encoded and decoded LOC
918 incorrectly, since we were interpreting the values of altitiude,
947 incorrectly, since we were interpreting the values of altitude,
919948 size, hprec, and vprec in meters instead of centimeters.
920949
921950 * dns/rdtypes/IN/WKS.py (WKS.from_wire): The WKS protocol value is
11991228
12001229 bar.foo 300 IN MX 0 blaz.foo
12011230
1202 after the second step (relativiation to zone origin).
1231 after the second step (relativization to zone origin).
12031232
12041233 * dns/namedict.py: added.
12051234
12201249 * dns/renderer.py: added new wire format rendering module and
12211250 converted message.py to use it. Applications which want
12221251 fine-grained control over the conversion to wire format may call
1223 the renderer directy, instead of having it called on their behalf
1252 the renderer directly, instead of having it called on their behalf
12241253 by the message code.
12251254
12261255 2003-07-02 Bob Halley <halley@dnspython.org>
00 Metadata-Version: 1.1
11 Name: dnspython
2 Version: 1.13.0
2 Version: 1.14.0
33 Summary: DNS toolkit
44 Home-page: http://www.dnspython.org
55 Author: Bob Halley
66 Author-email: halley@dnspython.org
77 License: BSD-like
8 Download-URL: http://www.dnspython.org/kits/1.13.0/dnspython-1.13.0.tar.gz
8 Download-URL: http://www.dnspython.org/kits/1.14.0/dnspython-1.14.0.tar.gz
99 Description: dnspython is a DNS toolkit for Python. It supports almost all
1010 record types. It can be used for queries, zone transfers, and dynamic
1111 updates. It supports TSIG authenticated messages and EDNS0.
0 dnspython [![Build Status](https://travis-ci.org/rthalley/dnspython.svg?branch=master)](https://travis-ci.org/rthalley/dnspython)
1
2 ## INTRODUCTION
3
4 dnspython is a DNS toolkit for Python. It supports almost all record
5 types. It can be used for queries, zone transfers, and dynamic
6 updates. It supports TSIG authenticated messages and EDNS0.
7
8 dnspython provides both high and low level access to DNS. The high
9 level classes perform queries for data of a given name, type, and
10 class, and return an answer set. The low level classes allow direct
11 manipulation of DNS zones, messages, names, and records.
12
13 To see a few of the ways dnspython can be used, look in the examples/
14 directory.
15
16 dnspython originated at Nominum where it was developed to facilitate
17 the testing of DNS software. Nominum has generously allowed it to be
18 open sourced under a BSD-style license, and helps support its future
19 development by continuing to employ the author :).
20
21 ## INSTALLATION
22 - If you have pip installed, you can do this
23 `pip install dnspython`
24 - If not just download the source file and unzip it, then run this
25 `sudo python setup.py install`
26
27 ## ABOUT THIS RELEASE
28
29 This is dnspython 1.14.0
30
31 New since 1.13.0:
32
33 CSYNC RRs are now supported.
34
35 dns/message.py (make_query): Setting any value which implies
36 EDNS will turn on EDNS if 'use_edns' has not been specified.
37
38 Bugs fixed since 1.13.0:
39
40 TSIG signature algorithm setting was broken by the Python 2
41 and Python 3 code line merge.
42
43 A bug in the LOC RR destroyed N/S and E/W distinctions within
44 a degree of the equator or prime merdian respectively.
45
46 Misc. fixes to deal with fallout from the Python 2 & 3 merge.
47 [issue #156], [issue #157], [issue #158], [issue #159],
48 [issue #160].
49
50 Running with python optimization on caused issues when
51 stripped docstrings were referenced. [issue #154]
52
53 dns.zone.from_text() erroneously required the zone to be provided.
54 [issue #153]
55
56 New since 1.12.0:
57
58 Dnspython now uses a single source for Python 2 and Python 3,
59 eliminating the painful merging between the Python 2 and Python 3
60 branches. Thank you so much to Arthur Gautier for taking on this
61 challenge and making it work! It was a big job!
62
63 Support for Python older than 2.6 dropped.
64
65 Support for Python older than 3.3 dropped.
66
67 Zone origin can be specified as a string.
68
69 A rich string representation for all DNSExceptions.
70
71 setuptools has replaced distutils
72
73 Added support for CAA, CDS, CDNSKEY, EUI48, EUI64, and URI RR
74 types.
75
76 Names now support the pickle protocol.
77
78 Ports can be specified per-nameserver in the stub resolver.
79
80 Bugs fixed since 1.12.0:
81
82 A number of Unicode name bugs have been fixed.
83
84 resolv.conf processing now rejects lines with too few tokens.
85
86 NameDicts now keep the max-depth value correct, and update properly.
87
88 New since 1.11.1:
89
90 Added dns.zone.to_text().
91
92 Added support for "options rotate" in /etc/resolv.conf.
93
94 dns.rdtypes.ANY.DNSKEY now has helpers functions to convert
95 between the numeric form of the flags and a set of
96 human-friendly strings
97
98 The reverse name of an IPv6 mapped IPv4 address is now in the
99 IPv4 reverse namespace.
100
101 The test system can now run the tests without requiring
102 dnspython to be installed.
103
104 Preliminary Elliptic Curve DNSSEC Validation (requires ecdsa module)
105
106 Bugs fixed since 1.11.1:
107
108 dnspython raised an exception when reading a masterfile starting
109 with leading whitespace
110
111 dnspython was affected by a python slicing API bug present on
112 64-bit windows.
113
114 Unicode escaping was applied at the wrong time.
115
116 RRSIG to_text() did not respect the relativize setting.
117
118 APL RRs with zero rdlength were rejected.
119
120 The tokenizer could put back an unescaped token.
121
122 Making a response to a message signed with TSIG was broken.
123
124 The IXFR state machine didn't handle long IXFR diffs.
125
126 New since 1.11.0:
127
128 Nothing
129
130 Bugs fixed since 1.11.0:
131
132 dns.resolver.Resolver erroneously referred to 'retry_servfail'
133 instead of 'self.retry_servfail'.
134
135 dns.tsigkeyring.to_text() would fail trying to convert the
136 keyname to text.
137
138 Multi-message TSIGs were broken for algorithms other than
139 HMAC-MD5 because we weren't passing the right digest module to
140 the HMAC code.
141
142 dns.dnssec._find_candidate_keys() tried to extract the key
143 from the wrong variable name.
144
145 $GENERATE tests were not backward compatible with python 2.4.
146
147 New since 1.10.0:
148
149 $GENERATE support
150
151 TLSA RR support
152
153 Added set_flags() method to dns.resolver.Resolver
154
155 Bugs fixed since 1.10.0:
156
157 Names with offsets >= 2^14 are no longer added to the compression
158 table.
159
160 The "::" syntax is not used to shorten a single 16-bit section of
161 the text form an IPv6 address.
162
163 Caches are now locked.
164
165 YXDOMAIN is raised if seen by the resolver.
166
167 Empty rdatasets are not printed.
168
169 DNSKEY key tags are no longer assumed to be unique.
170
171 New since 1.9.4:
172
173 Added dns.resolver.LRUCache. In this cache implementation,
174 the cache size is limited to a user-specified number of nodes,
175 and when adding a new node to a full cache the least-recently
176 used node is removed. If you're crawling the web or otherwise
177 doing lots of resolutions and you are using a cache, switching
178 to the LRUCache is recommended.
179
180 dns.resolver.query() will try TCP if a UDP response is
181 truncated.
182
183 The python socket module's DNS methods can be now be overridden
184 with implementations that use dnspython's resolver.
185
186 Old DNSSEC types KEY, NXT, and SIG have been removed.
187
188 Whitespace is allowed in SSHFP fingerprints.
189
190 Origin checking in dns.zone.from_xfr() can be disabled.
191
192 Trailing junk checking can be disabled.
193
194 A source port can be specified when creating a resolver query.
195
196 All EDNS values may now be specified to dns.message.make_query().
197
198 Bugs fixed since 1.9.4:
199
200 IPv4 and IPv6 address processing is now stricter.
201
202 Bounds checking of slices in rdata wire processing is now more
203 strict, and bounds errors (e.g. we got less data than was
204 expected) now raise dns.exception.FormError rather than
205 IndexError.
206
207 Specifying a source port without specifying source used to
208 have no effect, but now uses the wildcard address and the
209 specified port.
210
211 New since 1.9.3:
212
213 Nothing.
214
215 Bugs fixed since 1.9.3:
216
217 The rdata _wire_cmp() routine now handles relative names.
218
219 The SIG RR implementation was missing 'import struct'.
220
221 New since 1.9.2:
222
223 A boolean parameter, 'raise_on_no_answer', has been added to
224 the query() methods. In no-error, no-data situations, this
225 parameter determines whether NoAnswer should be raised or not.
226 If True, NoAnswer is raised. If False, then an Answer()
227 object with a None rrset will be returned.
228
229 Resolver Answer() objects now have a canonical_name field.
230
231 Rdata now have a __hash__ method.
232
233 Bugs fixed since 1.9.2:
234
235 Dnspython was erroneously doing case-insensitive comparisons
236 of the names in NSEC and RRSIG RRs.
237
238 We now use "is" and not "==" when testing what section an RR
239 is in.
240
241 The resolver now disallows metaqueries.
242
243 New since 1.9.1:
244
245 Nothing.
246
247 Bugs fixed since 1.9.1:
248
249 The dns.dnssec module didn't work at all due to missing
250 imports that escaped detection in testing because the test
251 suite also did the imports. The third time is the charm!
252
253 New since 1.9.0:
254
255 Nothing.
256
257 Bugs fixed since 1.9.0:
258
259 The dns.dnssec module didn't work with DSA due to namespace
260 contamination from a "from"-style import.
261
262 New since 1.8.0:
263
264 dnspython now uses poll() instead of select() when available.
265
266 Basic DNSSEC validation can be done using dns.dnsec.validate()
267 and dns.dnssec.validate_rrsig() if you have PyCrypto 2.3 or
268 later installed. Complete secure resolution is not yet
269 available.
270
271 Added key_id() to the DNSSEC module, which computes the DNSSEC
272 key id of a DNSKEY rdata.
273
274 Added make_ds() to the DNSSEC module, which returns the DS RR
275 for a given DNSKEY rdata.
276
277 dnspython now raises an exception if HMAC-SHA284 or
278 HMAC-SHA512 are used with a Python older than 2.5.2. (Older
279 Pythons do not compute the correct value.)
280
281 Symbolic constants are now available for TSIG algorithm names.
282
283 Bugs fixed since 1.8.0
284
285 dns.resolver.zone_for_name() didn't handle a query response
286 with a CNAME or DNAME correctly in some cases.
287
288 When specifying rdata types and classes as text, Unicode
289 strings may now be used.
290
291 Hashlib compatibility issues have been fixed.
292
293 dns.message now imports dns.edns.
294
295 The TSIG algorithm value was passed incorrectly to use_tsig()
296 in some cases.
297
298 New since 1.7.1:
299
300 Support for hmac-sha1, hmac-sha224, hmac-sha256, hmac-sha384
301 and hmac-sha512 has been contributed by Kevin Chen.
302
303 The tokenizer's tokens are now Token objects instead of (type,
304 value) tuples.
305
306 Bugs fixed since 1.7.1:
307
308 Escapes in masterfiles now work correctly. Previously they
309 were only working correctly when the text involved was part of
310 a domain name.
311
312 When constructing a DDNS update, if the present() method was
313 used with a single rdata, a zero TTL was not added.
314
315 The entropy pool needed locking to be thread safe.
316
317 The entropy pool's reading of /dev/random could cause
318 dnspython to block.
319
320 The entropy pool did buffered reads, potentially consuming more
321 randomness than we needed.
322
323 The entropy pool did not seed with high quality randomness on
324 Windows.
325
326 SRV records were compared incorrectly.
327
328 In the e164 query function, the resolver parameter was not
329 used.
330
331 New since 1.7.0:
332
333 Nothing
334
335 Bugs fixed since 1.7.0:
336
337 The 1.7.0 kitting process inadvertently omitted the code for the
338 DLV RR.
339
340 Negative DDNS prerequisites are now handled correctly.
341
342 New since 1.6.0:
343
344 Rdatas now have a to_digestable() method, which returns the
345 DNSSEC canonical form of the rdata, suitable for use in
346 signature computations.
347
348 The NSEC3, NSEC3PARAM, DLV, and HIP RR types are now supported.
349
350 An entropy module has been added and is used to randomize query ids.
351
352 EDNS0 options are now supported.
353
354 UDP IXFR is now supported.
355
356 The wire format parser now has a 'one_rr_per_rrset' mode, which
357 suppresses the usual coalescing of all RRs of a given type into a
358 single RRset.
359
360 Various helpful DNSSEC-related constants are now defined.
361
362 The resolver's query() method now has an optional 'source' parameter,
363 allowing the source IP address to be specified.
364
365 Bugs fixed since 1.6.0:
366
367 On Windows, the resolver set the domain incorrectly.
368
369 DS RR parsing only allowed one Base64 chunk.
370
371 TSIG validation didn't always use absolute names.
372
373 NSEC.to_text() only printed the last window.
374
375 We did not canonicalize IPv6 addresses before comparing them; we
376 would thus treat equivalent but different textual forms, e.g.
377 "1:00::1" and "1::1" as being non-equivalent.
378
379 If the peer set a TSIG error, we didn't raise an exception.
380
381 Some EDNS bugs in the message code have been fixed (see the ChangeLog
382 for details).
383
384 New since 1.5.0:
385 Added dns.inet.is_multicast().
386
387 Bugs fixed since 1.5.0:
388
389 If select() raises an exception due to EINTR, we should just
390 select() again.
391
392 If the queried address is a multicast address, then don't
393 check that the address of the response is the same as the
394 address queried.
395
396 NAPTR comparisons didn't compare the preference field due to a
397 typo.
398
399 Testing of whether a Windows NIC is enabled now works on Vista
400 thanks to code contributed by Paul Marks.
401
402 New since 1.4.0:
403
404 Answer objects now support more of the python sequence
405 protocol, forwarding the requests to the answer rrset.
406 E.g. "for a in answer" is equivalent to "for a in
407 answer.rrset", "answer[i]" is equivalent to "answer.rrset[i]",
408 and "answer[i:j]" is equivalent to "answer.rrset[i:j]".
409
410 Making requests using EDNS, including indicating DNSSEC awareness,
411 is now easier. For example, you can now say:
412
413 q = dns.message.make_query('www.dnspython.org', 'MX',
414 want_dnssec=True)
415
416 dns.query.xfr() can now be used for IXFR.
417
418 Support has been added for the DHCID, IPSECKEY, and SPF RR types.
419
420 UDP messages from unexpected sources can now be ignored by
421 setting ignore_unexpected to True when calling dns.query.udp.
422
423 Bugs fixed since 1.4.0:
424
425 If /etc/resolv.conf didn't exist, we raised an exception
426 instead of simply using the default resolver configuration.
427
428 In dns.resolver.Resolver._config_win32_fromkey(), we were
429 passing the wrong variable to self._config_win32_search().
430
431 New since 1.3.5:
432
433 You can now convert E.164 numbers to/from their ENUM name
434 forms:
435
436 >>> import dns.e164
437 >>> n = dns.e164.from_e164("+1 555 1212")
438 >>> n
439 <DNS name 2.1.2.1.5.5.5.1.e164.arpa.>
440 >>> dns.e164.to_e164(n)
441 '+15551212'
442
443 You can now convert IPv4 and IPv6 address to/from their
444 corresponding DNS reverse map names:
445
446 >>> import dns.reversename
447 >>> n = dns.reversename.from_address("127.0.0.1")
448 >>> n
449 <DNS name 1.0.0.127.in-addr.arpa.>
450 >>> dns.reversename.to_address(n)
451 '127.0.0.1'
452
453 You can now convert between Unicode strings and their IDN ACE
454 form:
455
456 >>> n = dns.name.from_text(u'les-\u00e9l\u00e8ves.example.')
457 >>> n
458 <DNS name xn--les-lves-50ai.example.>
459 >>> n.to_unicode()
460 u'les-\xe9l\xe8ves.example.'
461
462 The origin parameter to dns.zone.from_text() and dns.zone.to_text()
463 is now optional. If not specified, the origin will be taken from
464 the first $ORIGIN statement in the master file.
465
466 Sanity checking of a zone can be disabled; this is useful when
467 working with files which are zone fragments.
468
469 Bugs fixed since 1.3.5:
470
471 The correct delimiter was not used when retrieving the
472 list of nameservers from the registry in certain versions of
473 windows.
474
475 The floating-point version of latitude and longitude in LOC RRs
476 (float_latitude and float_longitude) had incorrect signs for
477 south latitudes and west longitudes.
478
479 BIND 8 TTL syntax is now accepted in all TTL-like places (i.e.
480 SOA fields refresh, retry, expire, and minimum; SIG/RRSIG
481 field original_ttl).
482
483 TTLs are now bounds checked when their text form is parsed,
484 and their values must be in the closed interval [0, 2^31 - 1].
485
486 New since 1.3.4:
487
488 In the resolver, if time goes backward a little bit, ignore
489 it.
490
491 zone_for_name() has been added to the resolver module. It
492 returns the zone which is authoritative for the specified
493 name, which is handy for dynamic update. E.g.
494
495 import dns.resolver
496 print dns.resolver.zone_for_name('www.dnspython.org')
497
498 will output "dnspython.org." and
499
500 print dns.resolver.zone_for_name('a.b.c.d.e.f.example.')
501
502 will output ".".
503
504 The default resolver can be fetched with the
505 get_default_resolver() method.
506
507 You can now get the parent (immediate superdomain) of a name
508 by using the parent() method.
509
510 Zone.iterate_rdatasets() and Zone.iterate_rdatas() now have
511 a default rdtype of dns.rdatatype.ANY like the documentation
512 says.
513
514 A Dynamic DNS example, ddns.py, has been added.
515
516 New since 1.3.3:
517
518 The source address and port may now be specified when calling
519 dns.query.{udp,tcp,xfr}.
520
521 The resolver now does exponential backoff each time it runs
522 through all of the nameservers.
523
524 Rcodes which indicate a nameserver is likely to be a
525 "permanent failure" for a query cause the nameserver to be removed
526 from the mix for that query.
527
528 New since 1.3.2:
529
530 dns.message.Message.find_rrset() now uses an index, vastly
531 improving the from_wire() performance of large messages such
532 as zone transfers.
533
534 Added dns.message.make_response(), which creates a skeletal
535 response for the specified query.
536
537 Added opcode() and set_opcode() convenience methods to the
538 dns.message.Message class. Added the request_payload
539 attribute to the Message class.
540
541 The 'file' parameter of dns.name.Name.to_wire() is now
542 optional; if omitted, the wire form will be returned as the
543 value of the function.
544
545 dns.zone.from_xfr() in relativization mode incorrectly set
546 zone.origin to the empty name.
547
548 The masterfile parser incorrectly rejected TXT records where a
549 value was not quoted.
550
551 New since 1.3.1:
552
553 The NSEC format doesn't allow specifying types by number, so
554 we shouldn't either. (Using the unknown type format is still
555 OK though.)
556
557 The resolver wasn't catching dns.exception.Timeout, so a timeout
558 erroneously caused the whole resolution to fail instead of just
559 going on to the next server.
560
561 The renderer module didn't import random, causing an exception
562 to be raised if a query id wasn't provided when a Renderer was
563 created.
564
565 The conversion of LOC milliseconds values from text to binary was
566 incorrect if the length of the milliseconds string was not 3.
567
568 New since 1.3.0:
569
570 Added support for the SSHFP type.
571
572 New since 1.2.0:
573
574 Added support for new DNSSEC types RRSIG, NSEC, and DNSKEY.
575
576 This release fixes all known bugs.
577
578 See the ChangeLog file for more detailed information on changes since
579 the prior release.
580
581
582 ## REQUIREMENTS
583
584 Python 2.6 or later.
585
586
587 ## HOME PAGE
588
589 For the latest in releases, documentation, and information, visit the
590 dnspython home page at
591
592 http://www.dnspython.org/
593
594
595
596 ## DOCUMENTATION
597
598 Documentation is sparse at the moment. Use pydoc, or read the HTML
599 documentation at the dnspython home page, or download the HTML
600 documentation.
601
602
603 ## BUG REPORTS
604
605 Bug reports may be sent to bugs@dnspython.org
606
607
608 ## MAILING LISTS
609
610 A number of mailing lists are available. Visit the dnspython home
611 page to subscribe or unsubscribe.
4242 @type otype: int
4343 @param wire: The wire-format message
4444 @type wire: string
45 @param current: The offet in wire of the beginning of the rdata.
45 @param current: The offset in wire of the beginning of the rdata.
4646 @type current: int
4747 @param olen: The length of the wire-format option data
4848 @type olen: int
139139 @type otype: int
140140 @param wire: The wire-format message
141141 @type wire: string
142 @param current: The offet in wire of the beginning of the rdata.
142 @param current: The offset in wire of the beginning of the rdata.
143143 @type current: int
144144 @param olen: The length of the wire-format option data
145145 @type olen: int
3333 In the new mode *args has to be empty and all kwargs has to exactly match
3434 set in class variable self.supp_kwargs. All kwargs are stored inside
3535 self.kwargs and used in new __str__ implementation to construct
36 formated message based on self.fmt string.
36 formatted message based on self.fmt string.
3737
3838 In the simplest case it is enough to override supp_kwargs and fmt
3939 class variables to get nice parametrized messages.
120120
121121 """The DNS operation timed out."""
122122 supp_kwargs = set(['timeout'])
123 fmt = "%s after {timeout} seconds" % __doc__[:-1]
123 fmt = "The DNS operation timed out after {timeout} seconds"
5757
5858 class BadEDNS(dns.exception.FormError):
5959
60 """OPT record occured somewhere other than the start of
60 """OPT record occurred somewhere other than the start of
6161 the additional data section."""
6262
6363
6464 class BadTSIG(dns.exception.FormError):
6565
66 """A TSIG record occured somewhere other than the end of
66 """A TSIG record occurred somewhere other than the end of
6767 the additional data section."""
6868
6969
10421042
10431043
10441044 def make_query(qname, rdtype, rdclass=dns.rdataclass.IN, use_edns=None,
1045 want_dnssec=False, ednsflags=0, payload=1280,
1045 want_dnssec=False, ednsflags=None, payload=None,
10461046 request_payload=None, options=None):
10471047 """Make a query message.
10481048
10491049 The query name, type, and class may all be specified either
10501050 as objects of the appropriate type, or as strings.
10511051
1052 The query will have a randomly choosen query id, and its DNS flags
1052 The query will have a randomly chosen query id, and its DNS flags
10531053 will be set to dns.flags.RD.
10541054
10551055 @param qname: The query name.
10871087 m.flags |= dns.flags.RD
10881088 m.find_rrset(m.question, qname, rdclass, rdtype, create=True,
10891089 force_unique=True)
1090 m.use_edns(use_edns, ednsflags, payload, request_payload, options)
1090 # only pass keywords on to use_edns if they have been set to a
1091 # non-None value. Setting a field will turn EDNS on if it hasn't
1092 # been configured.
1093 kwargs = {}
1094 if ednsflags is not None:
1095 kwargs['ednsflags'] = ednsflags
1096 if use_edns is None:
1097 use_edns = 0
1098 if payload is not None:
1099 kwargs['payload'] = payload
1100 if use_edns is None:
1101 use_edns = 0
1102 if request_payload is not None:
1103 kwargs['request_payload'] = request_payload
1104 if use_edns is None:
1105 use_edns = 0
1106 if options is not None:
1107 kwargs['options'] = options
1108 if use_edns is None:
1109 use_edns = 0
1110 kwargs['edns'] = use_edns
1111 m.use_edns(**kwargs)
10911112 m.want_dnssec(want_dnssec)
10921113 return m
10931114
225225 def fullcompare(self, other):
226226 """Compare two names, returning a 3-tuple (relation, order, nlabels).
227227
228 I{relation} describes the relation ship beween the names,
228 I{relation} describes the relation ship between the names,
229229 and is one of: dns.name.NAMERELN_NONE,
230230 dns.name.NAMERELN_SUPERDOMAIN, dns.name.NAMERELN_SUBDOMAIN,
231231 dns.name.NAMERELN_EQUAL, or dns.name.NAMERELN_COMMONANCESTOR
378378 def to_unicode(self, omit_final_dot=False):
379379 """Convert name to Unicode text format.
380380
381 IDN ACE lables are converted to Unicode.
381 IDN ACE labels are converted to Unicode.
382382
383383 @param omit_final_dot: If True, don't emit the final dot (denoting the
384384 root label) for absolute names. The default is False.
586586 def from_unicode(text, origin=root):
587587 """Convert unicode text into a Name object.
588588
589 Lables are encoded in IDN ACE form.
589 Labels are encoded in IDN ACE form.
590590
591591 @rtype: dns.name.Name object
592592 """
263263 A Timeout exception will be raised if the operation is not completed
264264 by the expiration time.
265265 """
266 s = ''
266 s = b''
267267 while count > 0:
268268 _wait_for_readable(sock, expiration)
269269 n = sock.recv(count)
270 if n == '':
270 if n == b'':
271271 raise EOFError
272272 count = count - len(n)
273273 s = s + n
291291 s.connect(address)
292292 except socket.error:
293293 (ty, v) = sys.exc_info()[:2]
294 if v[0] != errno.EINPROGRESS and \
295 v[0] != errno.EWOULDBLOCK and \
296 v[0] != errno.EALREADY:
294
295 if hasattr(v, 'errno'):
296 v_err = v.errno
297 else:
298 v_err = v[0]
299 if v_err not in [errno.EINPROGRESS, errno.EWOULDBLOCK, errno.EALREADY]:
297300 raise v
298301
299302
6161 def from_text(text):
6262 """Convert text into an rcode.
6363
64 @param text: the texual rcode
64 @param text: the textual rcode
6565 @type text: string
6666 @raises UnknownRcode: the rcode is unknown
6767 @rtype: int
285285 @type rdtype: int
286286 @param wire: The wire-format message
287287 @type wire: string
288 @param current: The offet in wire of the beginning of the rdata.
288 @param current: The offset in wire of the beginning of the rdata.
289289 @type current: int
290290 @param rdlen: The length of the wire-format rdata
291291 @type rdlen: int
450450 @type rdtype: int
451451 @param wire: The wire-format message
452452 @type wire: string
453 @param current: The offet in wire of the beginning of the rdata.
453 @param current: The offset in wire of the beginning of the rdata.
454454 @type current: int
455455 @param rdlen: The length of the wire-format rdata
456456 @type rdlen: int
8181 HIP = 55
8282 CDS = 59
8383 CDNSKEY = 60
84 CSYNC = 62
8485 SPF = 99
8586 UNSPEC = 103
8687 EUI48 = 108
150151 'HIP': HIP,
151152 'CDS': CDS,
152153 'CDNSKEY': CDNSKEY,
154 'CSYNC': CSYNC,
153155 'SPF': SPF,
154156 'UNSPEC': UNSPEC,
155157 'EUI48': EUI48,
0 # Copyright (C) 2004-2007, 2009-2011, 2016 Nominum, Inc.
1 #
2 # Permission to use, copy, modify, and distribute this software and its
3 # documentation for any purpose with or without fee is hereby granted,
4 # provided that the above copyright notice and this permission notice
5 # appear in all copies.
6 #
7 # THE SOFTWARE IS PROVIDED "AS IS" AND NOMINUM DISCLAIMS ALL WARRANTIES
8 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NOMINUM BE LIABLE FOR
10 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
13 # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14
15 import struct
16
17 import dns.exception
18 import dns.rdata
19 import dns.rdatatype
20 import dns.name
21 from dns._compat import xrange
22
23 class CSYNC(dns.rdata.Rdata):
24
25 """CSYNC record
26
27 @ivar serial: the SOA serial number
28 @type serial: int
29 @ivar flags: the CSYNC flags
30 @type flags: int
31 @ivar windows: the windowed bitmap list
32 @type windows: list of (window number, string) tuples"""
33
34 __slots__ = ['serial', 'flags', 'windows']
35
36 def __init__(self, rdclass, rdtype, serial, flags, windows):
37 super(CSYNC, self).__init__(rdclass, rdtype)
38 self.serial = serial
39 self.flags = flags
40 self.windows = windows
41
42 def to_text(self, origin=None, relativize=True, **kw):
43 text = ''
44 for (window, bitmap) in self.windows:
45 bits = []
46 for i in xrange(0, len(bitmap)):
47 byte = bitmap[i]
48 for j in xrange(0, 8):
49 if byte & (0x80 >> j):
50 bits.append(dns.rdatatype.to_text(window * 256 +
51 i * 8 + j))
52 text += (' ' + ' '.join(bits))
53 return '%d %d%s' % (self.serial, self.flags, text)
54
55 @classmethod
56 def from_text(cls, rdclass, rdtype, tok, origin=None, relativize=True):
57 serial = tok.get_uint32()
58 flags = tok.get_uint16()
59 rdtypes = []
60 while 1:
61 token = tok.get().unescape()
62 if token.is_eol_or_eof():
63 break
64 nrdtype = dns.rdatatype.from_text(token.value)
65 if nrdtype == 0:
66 raise dns.exception.SyntaxError("CSYNC with bit 0")
67 if nrdtype > 65535:
68 raise dns.exception.SyntaxError("CSYNC with bit > 65535")
69 rdtypes.append(nrdtype)
70 rdtypes.sort()
71 window = 0
72 octets = 0
73 prior_rdtype = 0
74 bitmap = bytearray(b'\0' * 32)
75 windows = []
76 for nrdtype in rdtypes:
77 if nrdtype == prior_rdtype:
78 continue
79 prior_rdtype = nrdtype
80 new_window = nrdtype // 256
81 if new_window != window:
82 windows.append((window, bitmap[0:octets]))
83 bitmap = bytearray(b'\0' * 32)
84 window = new_window
85 offset = nrdtype % 256
86 byte = offset // 8
87 bit = offset % 8
88 octets = byte + 1
89 bitmap[byte] = bitmap[byte] | (0x80 >> bit)
90
91 windows.append((window, bitmap[0:octets]))
92 return cls(rdclass, rdtype, serial, flags, windows)
93
94 def to_wire(self, file, compress=None, origin=None):
95 file.write(struct.pack('!IH', self.serial, self.flags))
96 for (window, bitmap) in self.windows:
97 file.write(struct.pack('!BB', window, len(bitmap)))
98 file.write(bitmap)
99
100 @classmethod
101 def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin=None):
102 if rdlen < 6:
103 raise dns.exception.FormError("CSYNC too short")
104 (serial, flags) = struct.unpack("!IH", wire[current: current + 6])
105 current += 6
106 rdlen -= 6
107 windows = []
108 while rdlen > 0:
109 if rdlen < 3:
110 raise dns.exception.FormError("CSYNC too short")
111 window = wire[current]
112 octets = wire[current + 1]
113 if octets == 0 or octets > 32:
114 raise dns.exception.FormError("bad CSYNC octets")
115 current += 2
116 rdlen -= 2
117 if rdlen < octets:
118 raise dns.exception.FormError("bad CSYNC bitmap length")
119 bitmap = bytearray(wire[current: current + octets].unwrap())
120 current += octets
121 rdlen -= octets
122 windows.append((window, bitmap))
123 return cls(rdclass, rdtype, serial, flags, windows)
5454 seconds = int(what // 1000)
5555 what -= int(seconds * 1000)
5656 what = int(what)
57 return (degrees * sign, minutes, seconds, what)
57 return (degrees, minutes, seconds, what, sign)
5858
5959
6060 def _tuple_to_float(what):
61 if what[0] < 0:
62 sign = -1
63 value = float(what[0]) * -1
64 else:
65 sign = 1
66 value = float(what[0])
61 value = float(what[0])
6762 value += float(what[1]) / 60.0
6863 value += float(what[2]) / 3600.0
6964 value += float(what[3]) / 3600000.0
70 return sign * value
65 return float(what[4]) * value
7166
7267
7368 def _encode_size(what, desc):
9287 """LOC record
9388
9489 @ivar latitude: latitude
95 @type latitude: (int, int, int, int) tuple specifying the degrees, minutes,
96 seconds, and milliseconds of the coordinate.
90 @type latitude: (int, int, int, int, sign) tuple specifying the degrees, minutes,
91 seconds, milliseconds, and sign of the coordinate.
9792 @ivar longitude: longitude
98 @type longitude: (int, int, int, int) tuple specifying the degrees,
99 minutes, seconds, and milliseconds of the coordinate.
93 @type longitude: (int, int, int, int, sign) tuple specifying the degrees,
94 minutes, seconds, milliseconds, and sign of the coordinate.
10095 @ivar altitude: altitude
10196 @type altitude: float
10297 @ivar size: size of the sphere
138133 self.vertical_precision = float(vprec)
139134
140135 def to_text(self, origin=None, relativize=True, **kw):
141 if self.latitude[0] > 0:
136 if self.latitude[4] > 0:
142137 lat_hemisphere = 'N'
143138 lat_degrees = self.latitude[0]
144139 else:
145140 lat_hemisphere = 'S'
146141 lat_degrees = -1 * self.latitude[0]
147 if self.longitude[0] > 0:
142 if self.longitude[4] > 0:
148143 long_hemisphere = 'E'
149144 long_degrees = self.longitude[0]
150145 else:
151146 long_hemisphere = 'W'
152147 long_degrees = -1 * self.longitude[0]
153148 text = "%d %d %d.%03d %s %d %d %d.%03d %s %0.2fm" % (
154 lat_degrees, self.latitude[1], self.latitude[2], self.latitude[3],
155 lat_hemisphere, long_degrees, self.longitude[1], self.longitude[2],
156 self.longitude[3], long_hemisphere, self.altitude / 100.0
149 self.latitude[0], self.latitude[1],
150 self.latitude[2], self.latitude[3], lat_hemisphere,
151 self.longitude[0], self.longitude[1], self.longitude[2],
152 self.longitude[3], long_hemisphere,
153 self.altitude / 100.0
157154 )
158155
159156 # do not print default values
168165
169166 @classmethod
170167 def from_text(cls, rdclass, rdtype, tok, origin=None, relativize=True):
171 latitude = [0, 0, 0, 0]
172 longitude = [0, 0, 0, 0]
168 latitude = [0, 0, 0, 0, 1]
169 longitude = [0, 0, 0, 0, 1]
173170 size = _default_size
174171 hprec = _default_hprec
175172 vprec = _default_vprec
203200 latitude[2] = int(t)
204201 t = tok.get_string()
205202 if t == 'S':
206 latitude[0] *= -1
203 latitude[4] = -1
207204 elif t != 'N':
208205 raise dns.exception.SyntaxError('bad latitude hemisphere value')
209206
236233 longitude[2] = int(t)
237234 t = tok.get_string()
238235 if t == 'W':
239 longitude[0] *= -1
236 longitude[4] = -1
240237 elif t != 'E':
241238 raise dns.exception.SyntaxError('bad longitude hemisphere value')
242239
269266 size, hprec, vprec)
270267
271268 def to_wire(self, file, compress=None, origin=None):
272 if self.latitude[0] < 0:
273 sign = -1
274 degrees = long(-1 * self.latitude[0])
275 else:
276 sign = 1
277 degrees = long(self.latitude[0])
278 milliseconds = (degrees * 3600000 +
269 milliseconds = (self.latitude[0] * 3600000 +
279270 self.latitude[1] * 60000 +
280271 self.latitude[2] * 1000 +
281 self.latitude[3]) * sign
272 self.latitude[3]) * self.latitude[4]
282273 latitude = long(0x80000000) + milliseconds
283 if self.longitude[0] < 0:
284 sign = -1
285 degrees = long(-1 * self.longitude[0])
286 else:
287 sign = 1
288 degrees = long(self.longitude[0])
289 milliseconds = (degrees * 3600000 +
274 milliseconds = (self.longitude[0] * 3600000 +
290275 self.longitude[1] * 60000 +
291276 self.longitude[2] * 1000 +
292 self.longitude[3]) * sign
277 self.longitude[3]) * self.longitude[4]
293278 longitude = long(0x80000000) + milliseconds
294279 altitude = long(self.altitude) + long(10000000)
295280 size = _encode_size(self.size, "size")
8787 then L{dns.exception.TooBig} will be raised.
8888 @type max_size: int
8989 @param origin: the origin to use when rendering relative names
90 @type origin: dns.name.Namem or None.
90 @type origin: dns.name.Name or None.
9191 """
9292
9393 self.output = BytesIO()
4242 from ._compat import xrange, string_types
4343
4444 if sys.platform == 'win32':
45 import _winreg
46
45 try:
46 import winreg as _winreg
47 except ImportError:
48 import _winreg
4749
4850 class NXDOMAIN(dns.exception.DNSException):
4951
7981 class NoAnswer(dns.exception.DNSException):
8082
8183 """The DNS response does not contain an answer to the question."""
82 fmt = '%s: {query}' % __doc__[:-1]
84 fmt = 'The DNS response does not contain an answer ' + \
85 'to the question: {query}'
8386 supp_kwargs = set(['response'])
8487
8588 def _fmt_kwargs(self, **kwargs):
2424 import dns.name
2525 from ._compat import long, string_types
2626
27
2827 class BadTime(dns.exception.DNSException):
2928
3029 """The current time is not within the TSIG's validity time."""
6766 HMAC_SHA256 = dns.name.from_text("hmac-sha256")
6867 HMAC_SHA384 = dns.name.from_text("hmac-sha384")
6968 HMAC_SHA512 = dns.name.from_text("hmac-sha512")
69
70 _hashes = {
71 HMAC_SHA224: 'SHA224',
72 HMAC_SHA256: 'SHA256',
73 HMAC_SHA384: 'SHA384',
74 HMAC_SHA512: 'SHA512',
75 HMAC_SHA1: 'SHA1',
76 HMAC_MD5: 'MD5',
77 }
7078
7179 default_algorithm = HMAC_MD5
7280
201209 algorithm = dns.name.from_text(algorithm)
202210
203211 try:
204 return (algorithm.to_digestable(), dns.hash.hashes[algorithm])
212 return (algorithm.to_digestable(), dns.hash.hashes[_hashes[algorithm]])
205213 except KeyError:
206214 raise NotImplementedError("TSIG algorithm " + str(algorithm) +
207215 " is not supported")
1515 """dnspython release version information."""
1616
1717 MAJOR = 1
18 MINOR = 13
18 MINOR = 14
1919 MICRO = 0
2020 RELEASELEVEL = 0x0f
2121 SERIAL = 0
8989 @param rdclass: The zone's rdata class; the default is class IN.
9090 @type rdclass: int"""
9191
92 if isinstance(origin, string_types):
93 origin = dns.name.from_text(origin)
94 elif not isinstance(origin, dns.name.Name):
95 raise ValueError("origin parameter must be convertable to a "
96 "DNS name")
97 if not origin.is_absolute():
98 raise ValueError("origin parameter must be an absolute name")
92 if origin is not None:
93 if isinstance(origin, string_types):
94 origin = dns.name.from_text(origin)
95 elif not isinstance(origin, dns.name.Name):
96 raise ValueError("origin parameter must be convertible to a "
97 "DNS name")
98 if not origin.is_absolute():
99 raise ValueError("origin parameter must be an absolute name")
99100 self.origin = origin
100101 self.rdclass = rdclass
101102 self.nodes = {}
126127 if isinstance(name, string_types):
127128 name = dns.name.from_text(name, None)
128129 elif not isinstance(name, dns.name.Name):
129 raise KeyError("name parameter must be convertable to a DNS name")
130 raise KeyError("name parameter must be convertible to a DNS name")
130131 if name.is_absolute():
131132 if not name.is_subdomain(self.origin):
132133 raise KeyError(
00 Metadata-Version: 1.1
11 Name: dnspython
2 Version: 1.13.0
2 Version: 1.14.0
33 Summary: DNS toolkit
44 Home-page: http://www.dnspython.org
55 Author: Bob Halley
66 Author-email: halley@dnspython.org
77 License: BSD-like
8 Download-URL: http://www.dnspython.org/kits/1.13.0/dnspython-1.13.0.tar.gz
8 Download-URL: http://www.dnspython.org/kits/1.14.0/dnspython-1.14.0.tar.gz
99 Description: dnspython is a DNS toolkit for Python. It supports almost all
1010 record types. It can be used for queries, zone transfers, and dynamic
1111 updates. It supports TSIG authenticated messages and EDNS0.
00 ChangeLog
11 LICENSE
22 MANIFEST.in
3 README.md
34 setup.py
45 dns/__init__.py
56 dns/_compat.py
5152 dns/rdtypes/ANY/CDS.py
5253 dns/rdtypes/ANY/CERT.py
5354 dns/rdtypes/ANY/CNAME.py
55 dns/rdtypes/ANY/CSYNC.py
5456 dns/rdtypes/ANY/DLV.py
5557 dns/rdtypes/ANY/DNAME.py
5658 dns/rdtypes/ANY/DNSKEY.py
198198 p.print_help()
199199 sys.exit(64)
200200
201 # Open file desriptors
201 # Open file descriptors
202202 if not opts.use_vc:
203203 oldn, newn = args
204204 else:
1717 import sys
1818 from setuptools import setup
1919
20 version = '1.13.0'
20 version = '1.14.0'
2121
2222 kwargs = {
2323 'name' : 'dnspython',
1212 ; NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
1313 ; WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414
15 ; $Id: example,v 1.13 2004/03/19 00:06:37 halley Exp $
15 ; $Id: example 265924 2016-05-20 18:26:42Z bwelling $
1616
1717 $ORIGIN .
1818 $TTL 300 ; 5 minutes
19 example IN SOA ns1.example. hostmaster.example. (
20 1 ; serial
21 2000 ; refresh (2000 seconds)
22 2000 ; retry (2000 seconds)
23 1814400 ; expire (3 weeks)
24 3600 ; minimum (1 hour)
25 )
19 example IN SOA ns1.example. hostmaster.example. 1 2 3 4 5
2620 example. NS ns1.example.
2721 ns1.example. A 10.53.0.1
2822 example. NS ns2.example.
2923 ns2.example. A 10.53.0.2
3024
3125 $ORIGIN example.
26 @ NSEC3PARAM 1 1 12 aabbccdd
27 @ NSEC3PARAM 1 1 12 -
3228 * MX 10 mail
3329 a TXT "foo foo foo"
3430 PTR foo.net.
35 ;; The next line not starting with ';;' is leading whitespace followed by
36 ;; EOL. We want to treat that as if EOL had appeared alone.
37
38 ;; The next line not starting with ';;' is leading whitespace followed by
39 ;; a comment followed by EOL. We want to treat that as if EOL had appeared
40 ;; alone.
41 ; foo
4231 $TTL 3600 ; 1 hour
4332 a01 A 0.0.0.0
4433 a02 A 255.255.255.255
4534 ;;
46 ;; XXXRTH dnspython doesn't currently implement A6, and since
47 ;; A6 records are effectively dead, it may never do so.
48 ;;
49 ;;a601 A6 0 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
50 ;; A6 64 ::ffff:ffff:ffff:ffff foo.
51 ;; A6 127 ::1 foo.
52 ;; A6 128 .
35 ;a601 A6 0 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
36 ; A6 64 ::ffff:ffff:ffff:ffff foo.
37 ; A6 127 ::1 foo.
38 ; A6 128 .
5339 aaaa01 AAAA ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
5440 aaaa02 AAAA ::1
5541 afsdb01 AFSDB 0 hostname
5844 b CNAME foo.net.
5945 c A 73.80.65.49
6046 $TTL 3600 ; 1 hour
61 cert01 CERT 65534 65535 PRIVATEOID (
62 MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi
63 WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl
64 d80jEeC8aTrO+KKmCaY= )
47 cert01 CERT 65534 65535 PRIVATEOID MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
6548 cname01 CNAME cname-target.
6649 cname02 CNAME cname-target
6750 cname03 CNAME .
51 dhcid01 DHCID AAIBY2/AuCccgoJbsaxcQc9TUapptP69lOjxfNuVAA2kjEA=
52 dhcid02 DHCID AAEBOSD+XR3Os/0LozeXVqcNc7FwCfQdWL3b/NaiUDlW2No=
53 dhcid03 DHCID AAABxLmlskllE0MVjd57zHcWmEH3pCQ6VytcKD//7es/deY=
6854 $TTL 300 ; 5 minutes
6955 d A 73.80.65.49
7056 $TTL 3600 ; 1 hour
71 dhcid01 DHCID ( AAIBY2/AuCccgoJbsaxcQc9TUapptP69l
72 OjxfNuVAA2kjEA= )
73 dhcid02 DHCID ( AAEBOSD+XR3Os/0LozeXVqcNc7FwCfQdW
74 L3b/NaiUDlW2No= )
75 dhcid03 DHCID ( AAABxLmlskllE0MVjd57zHcWmEH3pCQ6V
76 ytcKD//7es/deY= )
7757 dname01 DNAME dname-target.
7858 dname02 DNAME dname-target
7959 dname03 DNAME .
10080 isdn02 ISDN "isdn-address" "subaddress"
10181 isdn03 ISDN "isdn-address"
10282 isdn04 ISDN "isdn-address" "subaddress"
103 ;; dnspython no longer supports old DNSSEC
104 ;;key01 KEY 512 255 1 (
105 ;; AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR
106 ;; yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3
107 ;; GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o
108 ;; jqf0BaqHT+8= )
109 ;;key02 KEY HOST|FLAG4 DNSSEC RSAMD5 (
110 ;; AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR
111 ;; yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3
112 ;; GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o
113 ;; jqf0BaqHT+8= )
83 ;key01 KEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8=
84 ;key02 KEY HOST|FLAG4 DNSSEC RSAMD5 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8=
11485 kx01 KX 10 kdc
11586 kx02 KX 10 .
11687 loc01 LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m
11788 loc02 LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20m 2000m 20m
11889 loc03 LOC 60 9 0.000 N 24 39 0.000 E 10.00m 90000000.00m 2000m 20m
119 loc04 LOC 60 9 1.5 N 24 39 0.000 E 10.00m 20m 2000m 20m
120 loc05 LOC 60 9 1.51 N 24 39 0.000 E 10.00m 20m 2000m 20m
90 loc04 LOC 60 9 1.5 N 24 39 0.000 E 10.00m 90000000.00m 2000m 20m
91 loc05 LOC 60 9 1.51 N 24 39 0.000 E 10.00m 90000000.00m 2000m 20m
92 loc06 LOC 60 9 1 N 24 39 0.000 E 10.00m 90000000.00m 2000m 20m
93 loc07 LOC 0 9 1 N 24 39 0.000 E 10.00m 90000000.00m 2000m 20m
94 loc08 LOC 0 9 1 S 24 39 0.000 E 10.00m 90000000.00m 2000m 20m
12195 ;;
12296 ;; XXXRTH These are all obsolete and unused. dnspython doesn't implement
12397 ;; them
137111 NSAP-PTR .
138112 nsap01 NSAP 0x47000580005a0000000001e133ffffff00016100
139113 nsap02 NSAP 0x47.000580005a0000000001e133ffffff000161.00
140 ;;nxt01 NXT a.secure ( NS SOA MX SIG KEY LOC NXT )
141 ;;nxt02 NXT . ( NSAP-PTR NXT )
142 ;;nxt03 NXT . ( A )
143 ;;nxt04 NXT . ( 127 )
114 ;nxt01 NXT a.secure ( NS SOA MX SIG KEY LOC NXT )
115 ;nxt02 NXT . ( NSAP-PTR NXT )
116 ;nxt03 NXT . ( A )
117 ;nxt04 NXT . ( 127 )
144118 ptr01 PTR example.
145119 px01 PX 65535 foo. bar.
146120 px02 PX 65535 . .
154128 ns A 73.80.65.49
155129 $ORIGIN example.
156130 $TTL 3600 ; 1 hour
157 ;;sig01 SIG NXT 1 3 3600 (
158 ;; 20200101000000 20030101000000 2143 foo
159 ;; MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi
160 ;; WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl
161 ;; d80jEeC8aTrO+KKmCaY= )
131 ;sig01 SIG NXT 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
162132 srv01 SRV 0 0 0 .
163133 srv02 SRV 65535 65535 65535 old-slow-box.example.com.
164134 $TTL 301 ; 5 minutes 1 second
165135 t A 73.80.65.49
166136 $TTL 3600 ; 1 hour
167 tlsa1 TLSA 3 1 1 a9cdf989b504fe5dca90c0d2167b6550570734f7c763e09fdf88904e06157065
168 tlsa2 TLSA 1 0 1 efddf0d915c7bdc5782c0881e1b2a95ad099fbdd06d7b1f77982d9364338d955
169 tlsa3 TLSA 1 0 2 81ee7f6c0ecc6b09b7785a9418f54432de630dd54dc6ee9e3c49de547708d236d4c413c3e97e44f969e635958aa410495844127c04883503e5b024cf7a8f6a94
137 tlsa1 TLSA 3 1 1 a9cdf989b504fe5dca90c0d2167b6550570734f7c763e09fdf88904e06157065
138 tlsa2 TLSA 1 0 1 efddf0d915c7bdc5782c0881e1b2a95ad099fbdd06d7b1f77982d9364338d955
139 tlsa3 TLSA 1 0 2 81ee7f6c0ecc6b09b7785a9418f54432de630dd54dc6ee9e3c49de547708d236d4c413c3e97e44f969e635958aa410495844127c04883503e5b024cf7a8f6a94
170140 txt01 TXT "foo"
171141 txt02 TXT "foo" "bar"
172142 txt03 TXT "foo"
191161 wks02 WKS 10.0.0.1 17 ( 0 1 2 53 )
192162 wks03 WKS 10.0.0.2 6 ( 65535 )
193163 x2501 X25 "123456789"
194 dlv01 DLV 12345 3 1 123456789abcdef67890123456789abcdef67890
195164 ds01 DS 12345 3 1 123456789abcdef67890123456789abcdef67890
196 cds01 CDS 12345 3 1 123456789abcdef67890123456789abcdef67890
197165 apl01 APL 1:192.168.32.0/21 !1:192.168.38.0/28
198166 apl02 APL 1:224.0.0.0/4 2:FF00:0:0:0:0:0:0:0/8
199167 unknown2 TYPE999 \# 8 0a0000010a000001
200 rrsig01 RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/ vILz45IkskceFGgiWCn/GxHhai6V AuHAoNUz4YoU1tVfSCSqQYn6//11 U6Nld80jEeC8aTrO+KKmCaY=
201 nsec01 NSEC a.secure. A MX RRSIG NSEC TYPE1234
202 nsec02 NSEC . NSAP-PTR NSEC
203 nsec03 NSEC . NSEC TYPE65535
204 dnskey01 DNSKEY 512 255 1 (
205 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR
206 yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3
207 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o
208 jqf0BaqHT+8= )
209 dnskey02 DNSKEY 257 3 RSAMD5 (
210 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR
211 yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3
212 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o
213 jqf0BaqHT+8= )
214 cdnskey01 CDNSKEY 256 3 8 (
215 AwEAAbmiLgh411Pz3v3XCSBrvYf52A/Gv55ItN1NbOLH
216 Cqt3Ec3p+VB/kQ87VjjMrycanZFnZT4l9uCFuYh21Ccy
217 xVpcxExbM0UuhX5rJoDyeFSXoQlkHrB01osPl5Vri5Ym
218 KtcmqGxZ9An0VSunohkyiX1SrNRZSdQnk9/pIHDe/c8D
219 )
220 ;
221 ; test known type using unknown RR syntax
222 ;
223 unknown3 A \# 4 7f000002
168 unknown3 A \# 4 7f000002
169 rrsig01 RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY=
170 nsec01 NSEC a.secure A MX RRSIG NSEC TYPE1234
171 nsec02 NSEC . ( NSAP-PTR NSEC )
172 nsec03 NSEC . ( NSEC TYPE65535 )
173 nsec301 NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr MX DNSKEY NS SOA NSEC3PARAM RRSIG
174 nsec302 NSEC3 1 1 12 - 2t7b4g4vsa5smi47k61mv5bv1a22bojr MX DNSKEY NS SOA NSEC3PARAM RRSIG
175 dnskey01 DNSKEY 512 255 1 AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8=
176 dnskey02 DNSKEY 257 3 RSAMD5 ( AQMFD5raczCJHViKtLYhWGz8hMY9UGRuniJDBzC7w0aR yzWZriO6i2odGWWQVucZqKVsENW91IOW4vqudngPZsY3 GvQ/xVA8/7pyFj6b7Esga60zyGW6LFe9r8n6paHrlG5o jqf0BaqHT+8= )
224177 sshfp1 SSHFP 1 1 aa549bfe898489c02d1715d97d79c57ba2fa76ab
225178 spf SPF "v=spf1 mx -all"
226179 ipseckey01 IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
228181 ipseckey03 IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
229182 ipseckey04 IPSECKEY 10 2 2 2001:0DB8:0:8002::2000:1 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
230183 ipseckey05 IPSECKEY 10 3 2 mygateway2 AQNRU3mG7TVTO2BkR47usntb102uFJtugbo6BSGvgqt4AQ==
231 nsec301 NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr MX DNSKEY NS SOA NSEC3PARAM RRSIG
232 nsec302 NSEC3 1 1 12 - 2t7b4g4vsa5smi47k61mv5bv1a22bojr MX DNSKEY NS SOA NSEC3PARAM RRSIG
233 nsec3param01 NSEC3PARAM 1 1 12 aabbccdd
234 nsec3param02 NSEC3PARAM 1 1 12 -
235 hip01 HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs1.example.com. rvs2
184 hip01 HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D
185 hip02 HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs.example.com.
186 hip03 HIP 2 200100107B1A74DF365639CC39F1D578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs1.example.com. rvs2.example.com.
187 cds01 CDS 12345 3 1 123456789abcdef67890123456789abcdef67890
188 cdnskey01 CDNSKEY 256 3 8 ( AwEAAbmiLgh411Pz3v3XCSBrvYf52A/Gv55ItN1NbOLH Cqt3Ec3p+VB/kQ87VjjMrycanZFnZT4l9uCFuYh21Ccy xVpcxExbM0UuhX5rJoDyeFSXoQlkHrB01osPl5Vri5Ym KtcmqGxZ9An0VSunohkyiX1SrNRZSdQnk9/pIHDe/c8D )
189 uri01 URI 10 1 "ftp://ftp1.example.com/public"
190 uri02 URI 10 1 "http://www.example.com/path"
236191 caa01 CAA 0 issue "ca.example.net"
237192 caa02 CAA 0 iodef "mailto:security@example.com"
238193 caa03 CAA 0 iodef "http://iodef.example.com/"
239194 caa04 CAA 0 issue "ca.example.net; account=230123"
240195 caa05 CAA 0 issue "ca.example.net; policy=ev"
241196 caa06 CAA 128 tbs "Unknown"
242 uri0q URI 10 1 "http://www.example.com/"
197 csync0 CSYNC 12345 0 A MX RRSIG NSEC TYPE1234
0 @ 300 IN SOA ns1 hostmaster 1 2000 2000 1814400 3600
0 @ 300 IN SOA ns1 hostmaster 1 2 3 4 5
11 @ 300 IN NS ns1
22 @ 300 IN NS ns2
3 @ 300 IN NSEC3PARAM 1 1 12 aabbccdd
4 @ 300 IN NSEC3PARAM 1 1 12 -
35 * 300 IN MX 10 mail
46 a 300 IN TXT "foo foo foo"
57 a 300 IN PTR foo.net.
2527 cname01 3600 IN CNAME cname-target.
2628 cname02 3600 IN CNAME cname-target
2729 cname03 3600 IN CNAME .
30 csync0 3600 IN CSYNC 12345 0 A MX RRSIG NSEC TYPE1234
2831 d 300 IN A 73.80.65.49
2932 dhcid01 3600 IN DHCID AAIBY2/AuCccgoJbsaxcQc9TUapptP69 lOjxfNuVAA2kjEA=
3033 dhcid02 3600 IN DHCID AAEBOSD+XR3Os/0LozeXVqcNc7FwCfQd WL3b/NaiUDlW2No=
3134 dhcid03 3600 IN DHCID AAABxLmlskllE0MVjd57zHcWmEH3pCQ6 VytcKD//7es/deY=
32 dlv01 3600 IN DLV 12345 3 1 123456789abcdef67890123456789abcdef67890
3335 dname01 3600 IN DNAME dname-target.
3436 dname02 3600 IN DNAME dname-target
3537 dname03 3600 IN DNAME .
4850 gpos01 3600 IN GPOS -22.6882 116.8652 250.0
4951 hinfo01 3600 IN HINFO "Generic PC clone" "NetBSD-1.4"
5052 hinfo02 3600 IN HINFO "PC" "NetBSD"
51 hip01 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs1.example.com. rvs2
53 hip01 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D
54 hip02 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs.example.com.
55 hip03 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs1.example.com. rvs2.example.com.
5256 ipseckey01 3600 IN IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtu gbo6BSGvgqt4AQ==
5357 ipseckey02 3600 IN IPSECKEY 10 0 2 . AQNRU3mG7TVTO2BkR47usntb102uFJtu gbo6BSGvgqt4AQ==
5458 ipseckey03 3600 IN IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtu gbo6BSGvgqt4AQ==
6367 loc01 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
6468 loc02 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
6569 loc03 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
66 loc04 3600 IN LOC 60 9 1.500 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
67 loc05 3600 IN LOC 60 9 1.510 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
70 loc04 3600 IN LOC 60 9 1.500 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
71 loc05 3600 IN LOC 60 9 1.510 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
72 loc06 3600 IN LOC 60 9 1.000 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
73 loc07 3600 IN LOC 0 9 1.000 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
74 loc08 3600 IN LOC 0 9 1.000 S 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
6875 mx01 3600 IN MX 10 mail
6976 mx02 3600 IN MX 10 .
7077 naptr01 3600 IN NAPTR 0 0 "" "" "" .
7582 nsap-ptr01 3600 IN NSAP-PTR .
7683 nsap01 3600 IN NSAP 0x47000580005a0000000001e133ffffff00016100
7784 nsap02 3600 IN NSAP 0x47000580005a0000000001e133ffffff00016100
78 nsec01 3600 IN NSEC a.secure. A MX RRSIG NSEC TYPE1234
85 nsec01 3600 IN NSEC a.secure A MX RRSIG NSEC TYPE1234
7986 nsec02 3600 IN NSEC . NSAP-PTR NSEC
8087 nsec03 3600 IN NSEC . NSEC TYPE65535
8188 nsec301 3600 IN NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA MX RRSIG DNSKEY NSEC3PARAM
8289 nsec302 3600 IN NSEC3 1 1 12 - 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA MX RRSIG DNSKEY NSEC3PARAM
83 nsec3param01 3600 IN NSEC3PARAM 1 1 12 aabbccdd
84 nsec3param02 3600 IN NSEC3PARAM 1 1 12 -
8590 ptr01 3600 IN PTR @
8691 px01 3600 IN PX 65535 foo. bar.
8792 px02 3600 IN PX 65535 . .
118123 b.u 300 IN A 73.80.65.49
119124 unknown2 3600 IN TYPE999 \# 8 0a0000010a000001
120125 unknown3 3600 IN A 127.0.0.2
121 uri0q 3600 IN URI 10 1 "http://www.example.com/"
126 uri01 3600 IN URI 10 1 "ftp://ftp1.example.com/public"
127 uri02 3600 IN URI 10 1 "http://www.example.com/path"
122128 wks01 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
123129 wks02 3600 IN WKS 10.0.0.1 17 0 1 2 53
124130 wks03 3600 IN WKS 10.0.0.2 6 65535
0 example. 300 IN SOA ns1.example. hostmaster.example. 1 2000 2000 1814400 3600
0 example. 300 IN SOA ns1.example. hostmaster.example. 1 2 3 4 5
11 example. 300 IN NS ns1.example.
22 example. 300 IN NS ns2.example.
3 example. 300 IN NSEC3PARAM 1 1 12 aabbccdd
4 example. 300 IN NSEC3PARAM 1 1 12 -
35 *.example. 300 IN MX 10 mail.example.
46 a.example. 300 IN TXT "foo foo foo"
57 a.example. 300 IN PTR foo.net.
2527 cname01.example. 3600 IN CNAME cname-target.
2628 cname02.example. 3600 IN CNAME cname-target.example.
2729 cname03.example. 3600 IN CNAME .
30 csync0.example. 3600 IN CSYNC 12345 0 A MX RRSIG NSEC TYPE1234
2831 d.example. 300 IN A 73.80.65.49
2932 dhcid01.example. 3600 IN DHCID AAIBY2/AuCccgoJbsaxcQc9TUapptP69 lOjxfNuVAA2kjEA=
3033 dhcid02.example. 3600 IN DHCID AAEBOSD+XR3Os/0LozeXVqcNc7FwCfQd WL3b/NaiUDlW2No=
3134 dhcid03.example. 3600 IN DHCID AAABxLmlskllE0MVjd57zHcWmEH3pCQ6 VytcKD//7es/deY=
32 dlv01.example. 3600 IN DLV 12345 3 1 123456789abcdef67890123456789abcdef67890
3335 dname01.example. 3600 IN DNAME dname-target.
3436 dname02.example. 3600 IN DNAME dname-target.example.
3537 dname03.example. 3600 IN DNAME .
4850 gpos01.example. 3600 IN GPOS -22.6882 116.8652 250.0
4951 hinfo01.example. 3600 IN HINFO "Generic PC clone" "NetBSD-1.4"
5052 hinfo02.example. 3600 IN HINFO "PC" "NetBSD"
51 hip01.example. 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs1.example.com. rvs2.example.
53 hip01.example. 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D
54 hip02.example. 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs.example.com.
55 hip03.example. 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs1.example.com. rvs2.example.com.
5256 ipseckey01.example. 3600 IN IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtu gbo6BSGvgqt4AQ==
5357 ipseckey02.example. 3600 IN IPSECKEY 10 0 2 . AQNRU3mG7TVTO2BkR47usntb102uFJtu gbo6BSGvgqt4AQ==
5458 ipseckey03.example. 3600 IN IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtu gbo6BSGvgqt4AQ==
6367 loc01.example. 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
6468 loc02.example. 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
6569 loc03.example. 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
66 loc04.example. 3600 IN LOC 60 9 1.500 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
67 loc05.example. 3600 IN LOC 60 9 1.510 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
70 loc04.example. 3600 IN LOC 60 9 1.500 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
71 loc05.example. 3600 IN LOC 60 9 1.510 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
72 loc06.example. 3600 IN LOC 60 9 1.000 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
73 loc07.example. 3600 IN LOC 0 9 1.000 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
74 loc08.example. 3600 IN LOC 0 9 1.000 S 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
6875 mx01.example. 3600 IN MX 10 mail.example.
6976 mx02.example. 3600 IN MX 10 .
7077 naptr01.example. 3600 IN NAPTR 0 0 "" "" "" .
7582 nsap-ptr01.example. 3600 IN NSAP-PTR .
7683 nsap01.example. 3600 IN NSAP 0x47000580005a0000000001e133ffffff00016100
7784 nsap02.example. 3600 IN NSAP 0x47000580005a0000000001e133ffffff00016100
78 nsec01.example. 3600 IN NSEC a.secure. A MX RRSIG NSEC TYPE1234
85 nsec01.example. 3600 IN NSEC a.secure.example. A MX RRSIG NSEC TYPE1234
7986 nsec02.example. 3600 IN NSEC . NSAP-PTR NSEC
8087 nsec03.example. 3600 IN NSEC . NSEC TYPE65535
8188 nsec301.example. 3600 IN NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA MX RRSIG DNSKEY NSEC3PARAM
8289 nsec302.example. 3600 IN NSEC3 1 1 12 - 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA MX RRSIG DNSKEY NSEC3PARAM
83 nsec3param01.example. 3600 IN NSEC3PARAM 1 1 12 aabbccdd
84 nsec3param02.example. 3600 IN NSEC3PARAM 1 1 12 -
8590 ptr01.example. 3600 IN PTR example.
8691 px01.example. 3600 IN PX 65535 foo. bar.
8792 px02.example. 3600 IN PX 65535 . .
118123 b.u.example. 300 IN A 73.80.65.49
119124 unknown2.example. 3600 IN TYPE999 \# 8 0a0000010a000001
120125 unknown3.example. 3600 IN A 127.0.0.2
121 uri0q.example. 3600 IN URI 10 1 "http://www.example.com/"
126 uri01.example. 3600 IN URI 10 1 "ftp://ftp1.example.com/public"
127 uri02.example. 3600 IN URI 10 1 "http://www.example.com/path"
122128 wks01.example. 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
123129 wks02.example. 3600 IN WKS 10.0.0.1 17 0 1 2 53
124130 wks03.example. 3600 IN WKS 10.0.0.2 6 65535
0 @ 300 IN SOA ns1 hostmaster 1 2000 2000 1814400 3600
0 @ 300 IN SOA ns1 hostmaster 1 2 3 4 5
11 @ 300 IN NS ns1
22 @ 300 IN NS ns2
3 @ 300 IN NSEC3PARAM 1 1 12 aabbccdd
4 @ 300 IN NSEC3PARAM 1 1 12 -
35 * 300 IN MX 10 mail
46 a 300 IN TXT "foo foo foo"
57 a 300 IN PTR foo.net.
2527 cname01 3600 IN CNAME cname-target.
2628 cname02 3600 IN CNAME cname-target
2729 cname03 3600 IN CNAME .
30 csync0 3600 IN CSYNC 12345 0 A MX RRSIG NSEC TYPE1234
2831 d 300 IN A 73.80.65.49
2932 dhcid01 3600 IN DHCID AAIBY2/AuCccgoJbsaxcQc9TUapptP69 lOjxfNuVAA2kjEA=
3033 dhcid02 3600 IN DHCID AAEBOSD+XR3Os/0LozeXVqcNc7FwCfQd WL3b/NaiUDlW2No=
3134 dhcid03 3600 IN DHCID AAABxLmlskllE0MVjd57zHcWmEH3pCQ6 VytcKD//7es/deY=
32 dlv01 3600 IN DLV 12345 3 1 123456789abcdef67890123456789abcdef67890
3335 dname01 3600 IN DNAME dname-target.
3436 dname02 3600 IN DNAME dname-target
3537 dname03 3600 IN DNAME .
4850 gpos01 3600 IN GPOS -22.6882 116.8652 250.0
4951 hinfo01 3600 IN HINFO "Generic PC clone" "NetBSD-1.4"
5052 hinfo02 3600 IN HINFO "PC" "NetBSD"
51 hip01 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs1.example.com. rvs2
53 hip01 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D
54 hip02 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs.example.com.
55 hip03 3600 IN HIP 2 200100107b1a74df365639cc39f1d578 AwEAAbdxyhNuSutc5EMzxTs9LBPCIkOFH8cIvM4p9+LrV4e19WzK00+CI6zBCQTdtWsuxKbWIy87UOoJTwkUs7lBu+Upr1gsNrut79ryra+bSRGQb1slImA8YVJyuIDsj7kwzG7jnERNqnWxZ48AWkskmdHaVDP4BcelrTI3rMXdXF5D rvs1.example.com. rvs2.example.com.
5256 ipseckey01 3600 IN IPSECKEY 10 1 2 192.0.2.38 AQNRU3mG7TVTO2BkR47usntb102uFJtu gbo6BSGvgqt4AQ==
5357 ipseckey02 3600 IN IPSECKEY 10 0 2 . AQNRU3mG7TVTO2BkR47usntb102uFJtu gbo6BSGvgqt4AQ==
5458 ipseckey03 3600 IN IPSECKEY 10 3 2 mygateway.example.com. AQNRU3mG7TVTO2BkR47usntb102uFJtu gbo6BSGvgqt4AQ==
6367 loc01 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
6468 loc02 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
6569 loc03 3600 IN LOC 60 9 0.000 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
66 loc04 3600 IN LOC 60 9 1.500 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
67 loc05 3600 IN LOC 60 9 1.510 N 24 39 0.000 E 10.00m 20.00m 2000.00m 20.00m
70 loc04 3600 IN LOC 60 9 1.500 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
71 loc05 3600 IN LOC 60 9 1.510 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
72 loc06 3600 IN LOC 60 9 1.000 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
73 loc07 3600 IN LOC 0 9 1.000 N 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
74 loc08 3600 IN LOC 0 9 1.000 S 24 39 0.000 E 10.00m 90000000.00m 2000.00m 20.00m
6875 mx01 3600 IN MX 10 mail
6976 mx02 3600 IN MX 10 .
7077 naptr01 3600 IN NAPTR 0 0 "" "" "" .
7582 nsap-ptr01 3600 IN NSAP-PTR .
7683 nsap01 3600 IN NSAP 0x47000580005a0000000001e133ffffff00016100
7784 nsap02 3600 IN NSAP 0x47000580005a0000000001e133ffffff00016100
78 nsec01 3600 IN NSEC a.secure. A MX RRSIG NSEC TYPE1234
85 nsec01 3600 IN NSEC a.secure A MX RRSIG NSEC TYPE1234
7986 nsec02 3600 IN NSEC . NSAP-PTR NSEC
8087 nsec03 3600 IN NSEC . NSEC TYPE65535
8188 nsec301 3600 IN NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA MX RRSIG DNSKEY NSEC3PARAM
8289 nsec302 3600 IN NSEC3 1 1 12 - 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA MX RRSIG DNSKEY NSEC3PARAM
83 nsec3param01 3600 IN NSEC3PARAM 1 1 12 aabbccdd
84 nsec3param02 3600 IN NSEC3PARAM 1 1 12 -
8590 ptr01 3600 IN PTR @
8691 px01 3600 IN PX 65535 foo. bar.
8792 px02 3600 IN PX 65535 . .
118123 b.u 300 IN A 73.80.65.49
119124 unknown2 3600 IN TYPE999 \# 8 0a0000010a000001
120125 unknown3 3600 IN A 127.0.0.2
121 uri0q 3600 IN URI 10 1 "http://www.example.com/"
126 uri01 3600 IN URI 10 1 "ftp://ftp1.example.com/public"
127 uri02 3600 IN URI 10 1 "http://www.example.com/path"
122128 wks01 3600 IN WKS 10.0.0.1 6 0 1 2 21 23
123129 wks02 3600 IN WKS 10.0.0.1 17 0 1 2 53
124130 wks03 3600 IN WKS 10.0.0.2 6 65535
208208 self.failUnlessRaises(dns.dnssec.ValidationFailure, bad)
209209
210210 @unittest.skipIf(not dns.dnssec._have_ecdsa,
211 "python ECDSA can not be imported")
211 "python ECDSA cannot be imported")
212212 def testAbsoluteECDSA384Good(self):
213213 dns.dnssec.validate(abs_ecdsa384_soa, abs_ecdsa384_soa_rrsig,
214214 abs_ecdsa384_keys, None, when4)
215215
216216 @unittest.skipIf(not dns.dnssec._have_ecdsa,
217 "python ECDSA can not be imported")
217 "python ECDSA cannot be imported")
218218 def testAbsoluteECDSA384Bad(self):
219219 def bad():
220220 dns.dnssec.validate(abs_other_ecdsa384_soa, abs_ecdsa384_soa_rrsig,
2020 import binascii
2121
2222 import dns.exception
23 import dns.flags
2324 import dns.message
2425 from dns._compat import xrange
2526
178179 m.use_edns(1)
179180 self.failUnless((m.ednsflags >> 16) & 0xFF == 1)
180181
182 def test_SettingNoEDNSOptionsImpliesNoEDNS(self):
183 m = dns.message.make_query('foo', 'A')
184 self.failUnless(m.edns == -1)
185
186 def test_SettingEDNSFlagsImpliesEDNS(self):
187 m = dns.message.make_query('foo', 'A', ednsflags=dns.flags.DO)
188 self.failUnless(m.edns == 0)
189
190 def test_SettingEDNSPayloadImpliesEDNS(self):
191 m = dns.message.make_query('foo', 'A', payload=4096)
192 self.failUnless(m.edns == 0)
193
194 def test_SettingEDNSRequestPayloadImpliesEDNS(self):
195 m = dns.message.make_query('foo', 'A', request_payload=4096)
196 self.failUnless(m.edns == 0)
197
198 def test_SettingOptionsImpliesEDNS(self):
199 m = dns.message.make_query('foo', 'A', options=[])
200 self.failUnless(m.edns == 0)
201
181202 if __name__ == '__main__':
182203 unittest.main()
3434
3535 def testEqual2(self):
3636 '''Test default values for size, horizontal and vertical precision.'''
37 r1 = dns.rdtypes.ANY.LOC.LOC(1, 29, (49, 11, 42, 400),
38 (16, 36, 29, 600), 22764.0) # centimeters
39 r2 = dns.rdtypes.ANY.LOC.LOC(1, 29, (49, 11, 42, 400),
40 (16, 36, 29, 600), 22764.0, # centimeters
37 r1 = dns.rdtypes.ANY.LOC.LOC(1, 29, (49, 11, 42, 400, 1),
38 (16, 36, 29, 600, 1),
39 22764.0) # centimeters
40 r2 = dns.rdtypes.ANY.LOC.LOC(1, 29, (49, 11, 42, 400, 1),
41 (16, 36, 29, 600, 1),
42 22764.0, # centimeters
4143 100.0, 1000000.00, 1000.0) # centimeters
4244 self.failUnless(r1 == r2, '"%s" != "%s"' % (r1, r2))
4345
4547 '''Test size, horizontal and vertical precision parsers: 100 cm == 1 m.
4648
4749 Parsers in from_text() and __init__() have to produce equal results.'''
48 r1 = dns.rdtypes.ANY.LOC.LOC(1, 29, (49, 11, 42, 400),
49 (16, 36, 29, 600), 22764.0,
50 r1 = dns.rdtypes.ANY.LOC.LOC(1, 29, (49, 11, 42, 400, 1),
51 (16, 36, 29, 600, 1), 22764.0,
5052 200.0, 1000.00, 200.0) # centimeters
5153 r2 = dns.rrset.from_text('FOO', 600, 'in', 'loc',
5254 '49 11 42.400 N 16 36 29.600 E 227.64m '
5860
5961 Parsers in from_text() and __init__() have produce equal result
6062 for values with and without trailing "m".'''
61 r1 = dns.rdtypes.ANY.LOC.LOC(1, 29, (49, 11, 42, 400),
62 (16, 36, 29, 600), 22764.0,
63 r1 = dns.rdtypes.ANY.LOC.LOC(1, 29, (49, 11, 42, 400, 1),
64 (16, 36, 29, 600, 1), 22764.0,
6365 200.0, 1000.00, 200.0) # centimeters
6466 r2 = dns.rrset.from_text('FOO', 600, 'in', 'loc',
6567 '49 11 42.400 N 16 36 29.600 E 227.64 '
413413 self.failUnlessRaises(dns.exception.SyntaxError, bad)
414414
415415 def testFirstRRStartsWithWhitespace(self):
416 # no name is specified, so default to the intial origin
416 # no name is specified, so default to the initial origin
417417 # no ttl is specified, so default to the initial TTL of 0
418418 z = dns.zone.from_text(' IN A 10.0.0.1', origin='example.',
419419 check_origin=False)
432432 z = dns.zone.Zone(1.0)
433433 self.failUnlessRaises(ValueError, bad2)
434434
435 def testZoneOriginNone(self):
436 z = dns.zone.Zone(None)
437
435438 if __name__ == '__main__':
436439 unittest.main()