Bob Halley [Wed, 8 Oct 2025 18:21:54 +0000 (11:21 -0700)]
Rename the getaddrinfo parameter "socktype" to "type" [#1231]
The socket type parameter to socket.getaddrinfo used to be called "socktype" in
Python 2, but was renamed to "type" in Python 3. We applied this change on
the python3 branch almost a decade ago, but it was lost in the "single code base,
only Python 3" update, also quite some time ago. It is now renamed to "type"
(again) so it matches the Python 3 code it is overriding.
Jakob Schlyter [Thu, 25 Sep 2025 18:01:43 +0000 (20:01 +0200)]
Initial changes to prepare for SIG(0) (#1202)
* # This is a combination of 6 commits.
# This is the 1st commit message:
Initial changes to prepare for SIG(0):
- Add shared RRSIGBase for code shared between RRSIG and SIG
- Add KEY RR
- Add SIG RR
# This is the commit message #2:
Parse flags mnemonics and symbolic protocol names
# This is the commit message #3:
RFC 2535 section 7.1 says "Note that if the type flags field has the NOKEY value, nothing appears after the algorithm octet."
# This is the commit message #4:
Include sphinx only for Python 3.11 or later (#1225)
* Include sphinx only for Python 3.11 or later
* Use python_version
# This is the commit message #5:
Save token before returning it (for exception handling)
# This is the commit message #6:
Replace get/unget with plain unget and last token
* Initial changes to prepare for SIG(0):
- Add shared RRSIGBase for code shared between RRSIG and SIG
- Add KEY RR
- Add SIG RR
- Parse flags mnemonics and symbolic protocol names
Bob Halley [Mon, 18 Aug 2025 18:11:32 +0000 (11:11 -0700)]
Make better APIs for creating sockets and TLS contexts (#1217)
* Make better APIs for creating sockets and TLS contexts for
code that wants to have persistent connections. [#1176].
This code keeps the ability to use dnspython when the ssl module
doesn't work, but moves the helper code to another module to declutter
and make testing and type checking easier.
We still have to make some type checking compromises, but we are
making fewer than before.
Brian Wellington [Sat, 26 Jul 2025 15:13:41 +0000 (08:13 -0700)]
Fix signing initially empty zone. (#1213)
dns.dnssec.sign_zone() fails if the SOA is added in the same transaction
that signs the zone, because it's not using the active transaction when
looking for the SOA. (#1210)
Brian Wellington [Mon, 21 Jul 2025 20:33:05 +0000 (13:33 -0700)]
Fix broken test.
With the change in #1209, an empty tuple is no longer invalid when
specifying resolvers. It was failing before because it was a tuple, and
tuples are now valid (and there are no checks for empty sequences).
Brian Wellington [Thu, 10 Jul 2025 20:55:55 +0000 (13:55 -0700)]
More TSIG fixes. (#1207)
* More TSIG fixes.
This attempts to fix the bug that when a message containing a TSIG
record is parsed from wire format, attempting to render it back to wire
format will either regenerate the TSIG (if the TSIG was verified) or
throw an exception (if the TSIG was not verified). In either case,
the rendered message should contain the TSIG record that was parsed.
Jason R. Coombs [Wed, 23 Apr 2025 13:57:54 +0000 (09:57 -0400)]
Update wmi extra to only install on Windows (#1192)
Since installing `dnspython[wmi]` is the recommended way to avoid querying dns servers on inactive interfaces (#1191), but WMI is only meaningful on Windows, perhaps the extra should only be installed on Windows.
Brian Wellington [Thu, 10 Apr 2025 22:21:11 +0000 (15:21 -0700)]
Fix want_dnssec semantics.
Calling dns.message.make_query() with ednsflags including dns.flags.DO
didn't work properly. The code would call Message.use_edns(), which
would do the right thing, and then call Message.want_dnssec(false)
because want_dnssec defaults False, which would overwrite the flags with
the wrong value.
This slightly changes the semantics, to make want_dnssec only have an
effect if it's True. That's already what the documentation says.
Bob Halley [Sat, 14 Dec 2024 19:26:17 +0000 (11:26 -0800)]
Move creating a socket for a DoH query into the address's try..except
block so if creating fails, e.g. due to no IPv6, we try other addressess
if we've got any. [#1169]
Brian Wellington [Fri, 29 Nov 2024 20:23:24 +0000 (12:23 -0800)]
Support registering new types with classes. (#1167)
* Support registering new types with classes.
Previously, dns.rdata.register_type() required passing a module which
contained the implementation of the new type, and it would extract the
class from the module. This change allows passing the class directly.