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.
dependabot[bot] [Sun, 17 Nov 2024 01:44:38 +0000 (17:44 -0800)]
Bump sphinx-rtd-theme from 3.0.1 to 3.0.2 (#1164)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.1 to 3.0.2.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.1...3.0.2)
Ryan Frantz [Fri, 18 Oct 2024 17:16:44 +0000 (13:16 -0400)]
Minor README updates (#1149)
- Consistently formats the `dnspython` name and some terminal commands.
- Tightens up a few lines to adhere what I presume is the preferred
80-character line limit.
Brian Wellington [Fri, 18 Oct 2024 16:36:02 +0000 (09:36 -0700)]
Fix AXFR-style IXFR with multiple messages. (#1151)
The inbound xfr code is conflating the expected rdtype in responses with
the incremental/replacement response style. This causes a problem when
an AXFR-style IXFR response spans multiple messages, as resetting the
style to AXFR (replacement) also changed the expected type in the
question section of future responses to AXFR.
This change separates out the style from the expected rdtype.
Brian Wellington [Fri, 11 Oct 2024 20:34:57 +0000 (13:34 -0700)]
Add dns.edns.Option.to_generic() (#1145)
* Add dns.edns.Option.to_generic()
Converts an EDNS option represented by a custom class into an equivalent
option represented by the generic option class. This is similar to the
existing dns.rdata.Rdata.to_generic() method.
Also, adds a specialization to the existing dns.rdata.Rdata.to_generic()
method for GenericRdata, to avoid extra work for applications that want
to convert all rdata to generic form.
dependabot[bot] [Wed, 9 Oct 2024 16:47:28 +0000 (09:47 -0700)]
Bump sphinx-rtd-theme from 3.0.0 to 3.0.1 (#1144)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 3.0.0 to 3.0.1.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/3.0.0...3.0.1)
dependabot[bot] [Tue, 8 Oct 2024 15:22:35 +0000 (08:22 -0700)]
Bump sphinx-rtd-theme from 2.0.0 to 3.0.0 (#1142)
Bumps [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme) from 2.0.0 to 3.0.0.
- [Changelog](https://github.com/readthedocs/sphinx_rtd_theme/blob/master/docs/changelog.rst)
- [Commits](https://github.com/readthedocs/sphinx_rtd_theme/compare/2.0.0...3.0.0)
Bob Halley [Tue, 17 Sep 2024 12:56:14 +0000 (05:56 -0700)]
Add a copy mode to dns.message.make_response(). (#1131)
Add a copy mode to dns.message.make_response().
If the mode is none, then a default copy mode appropriate for the opcode will
be used. This is currently always dns.message.CopyMode.QUESTION.
If the mode is dns.message.CopyMode.QUESTION then only the question
section is copied.
If the mode is dns.message.CopyMode.EVERYTHING, then all sections are
copied other than OPT or TSIG records which are created appropriately
if needed instead of being copied.
If the mode is dns.message.CopyMode.NOTHING then no sections are
copied.
Bob Halley [Sat, 14 Sep 2024 15:51:39 +0000 (08:51 -0700)]
Check SAN for IP if using an address URL in https() [#1125].
Httpx needs us to set the "sni_hostname" extension if the
server in the URL is an IP address, as otherwise it will not
check the certificate. With this change, it will look for a
SAN with the IP address.