]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 months agofix: dev: Fix uninitialized pointer check on getipandkeylist
Colin Vidal [Fri, 28 Nov 2025 12:45:06 +0000 (13:45 +0100)] 
fix: dev: Fix uninitialized pointer check on getipandkeylist

Function `named_config_getipandkeylist` could, in case of error in the early code attempting to get the `port` or `tls-port`, make a pointer check on a non-initialized value. This is now fixed.

Merge branch 'colin/getipandkeylist-uinitstate' into 'main'

See merge request isc-projects/bind9!11303

6 months agofix unitiailized pointer check on getipandkeylist
Colin Vidal [Fri, 28 Nov 2025 10:55:32 +0000 (11:55 +0100)] 
fix unitiailized pointer check on getipandkeylist

Function `named_config_getipandkeylist` could, in case of error in the
early code attempting to get the `port` or `tls-port`, make a pointer
check on a non-initialized value. This is now fixed.

6 months agochg: test: Remove obsolete checks for PYTHON executable
Nicki Křížek [Fri, 28 Nov 2025 10:24:22 +0000 (11:24 +0100)] 
chg: test: Remove obsolete checks for PYTHON executable

Python has been required to run the system test suite for quite a while.
Remove the dated checks inside system tests which are no longer needed.

Merge branch 'nicki/cleanup-python-checks-system-tests' into 'main'

See merge request isc-projects/bind9!11292

6 months agoRemove obsolete dnspython prerequisite checks
Nicki Křížek [Thu, 27 Nov 2025 13:13:32 +0000 (14:13 +0100)] 
Remove obsolete dnspython prerequisite checks

dnspython has been mandatory to run system test for quite a while.
Remove all extraneous checks for this module from prereq.sh scipts.

6 months agoRemove extraneous prerequisite script for timeouts test
Nicki Křížek [Thu, 27 Nov 2025 13:00:21 +0000 (14:00 +0100)] 
Remove extraneous prerequisite script for timeouts test

The timeouts test already checks for dnspython>=2.0.0 in
test_tcp_timeouts.py and the prereq.sh file is not needed.

6 months agoRemove obsolete checks for PYTHON executable
Nicki Křížek [Thu, 27 Nov 2025 12:58:28 +0000 (13:58 +0100)] 
Remove obsolete checks for PYTHON executable

Python has been required to run the system test suite for quite a while.
Remove the dated checks inside system tests which are no longer needed.

6 months agofix: usr: Fix caching RRSIG covering cache NODATA record
Ondřej Surý [Fri, 28 Nov 2025 09:51:38 +0000 (10:51 +0100)] 
fix: usr:  Fix caching RRSIG covering cache NODATA record

When a RRSIG for type that we already have cached NODATA record was cached due to mismatch of the records on the upstream nameservers, an assertion failure could trigger.  This has been fixed.

Closes #5633

Merge branch '5633-evict-related-rrsig-when-adding-negative-header' into 'main'

See merge request isc-projects/bind9!11228

6 months agoFix not caching RRSIG covering cache NODATA record
Ondřej Surý [Sat, 8 Nov 2025 11:10:51 +0000 (12:10 +0100)] 
Fix not caching RRSIG covering cache NODATA record

During refactoring, a condition that prevented caching RRSIGs for
records that we already have cached NODATA records was changed in an
invalid way.  This was caught later when a cached NODATA(type) +
RRSIG(type) was found in the cache and caused an assertion failure.

Fix and simplify condition that prevents adding such RRSIGs.

6 months agoRefactor the conditions when adding new NEGATIVE header
Ondřej Surý [Sat, 8 Nov 2025 11:09:18 +0000 (12:09 +0100)] 
Refactor the conditions when adding new NEGATIVE header

Refactor the block when adding existing negative header under common
block, so it is easier to understand that the two conditions inside are
related.

6 months agoEvict the RRSIG when adding negative header
Ondřej Surý [Sat, 8 Nov 2025 11:06:20 +0000 (12:06 +0100)] 
Evict the RRSIG when adding negative header

Formerly, we've evicted the RRSIG(type) only when we were changing
existing header from positive to negative.  Move the eviction routine
for the RRSIG to a common path, so the RRSIG also gets evicted when we
are adding new negative header for a specific type.

6 months agofix: usr: Fix parsing bug in remote-servers with key or tls
Colin Vidal [Fri, 28 Nov 2025 08:51:24 +0000 (09:51 +0100)] 
fix: usr: Fix parsing bug in remote-servers with key or tls

The :any:`remote-servers` clause enable the following pattern using a named ``server-list``:

remote-servers a { 1.2.3.4; ... };
remote-servers b { a key foo; };

However, such configuration was wrongly rejected, with an "unexpected token 'foo'" error. Such configuration is now accepted.

Closes #5646

Merge branch '5646-fix-named-remote-servers-key-tls' into 'main'

See merge request isc-projects/bind9!11252

6 months agoadd checkconf test for named remote-servers
Colin Vidal [Wed, 19 Nov 2025 16:36:17 +0000 (17:36 +0100)] 
add checkconf test for named remote-servers

Add checkconf system test to cover usage of `remote-servers` with a
named server-list and a `key` and/or a `tls` option.

6 months agocheck validity of key and tls in a server-list
Colin Vidal [Tue, 25 Nov 2025 14:45:22 +0000 (15:45 +0100)] 
check validity of key and tls in a server-list

If a `key` or `tls` is associated to an IP address inside a server-list,
only the `tls` existence in the configuration was checked. Also, if
`key` or `tls` is associated to a named server-list inside a
server-list, there was no check at all.

Add the check for making sure a `key` is defined in the configuration,
as well as the check for `key` and `tls` when used on a named
server-list.

6 months agocheck remote-servers list correctness
Colin Vidal [Tue, 25 Nov 2025 14:34:26 +0000 (15:34 +0100)] 
check remote-servers list correctness

`check.c` only checks if `remote-servers`, `primaries`, etc. are not
duplicated inside the configuration file, but does not check the
correctness of its definition. This commit fixes this by calling
`validate_remotes()` for each `remote-servers` (and other aliases),
which validates the correctness of the definition itself (this is the
same call done to validate other cases like `also-notify`, etc.).

6 months agorefactoring of `named_config_getipandkeylist`
Colin Vidal [Tue, 25 Nov 2025 12:56:37 +0000 (13:56 +0100)] 
refactoring of `named_config_getipandkeylist`

Function `named_config_getipandkeylist()` processes the nested lists by
overriding the current local variable of the function, jumping back to
the beginning of the list processing. Of course, in order to go back to
the previous state and process the remaining items of the current list,
a "stack" array is used in order to put and get back the next list
element and associated values.

This makes the logic quite complex and error prone. Instead, this commit
changes the logic by recursing into the nested list (while sharing a
state between all the invocations). The processing is fundamentally
identical, but instead of "manually" handling the stack to go back to
the previous state (and process remaining elements of the current list),
takes advantage of recursion.

6 months agominimal fix for missing `key`/`tls` in named `remote-servers`
Colin Vidal [Tue, 25 Nov 2025 09:16:13 +0000 (10:16 +0100)] 
minimal fix for missing `key`/`tls` in named `remote-servers`

The following case

   remote-servers foo { 10.53.0.5; };
   remote-servers bar { foo key fookey; };

did not work: the `fookey` was silently ignored. No matter how `bar` was
used, the server `10.53.0.5` wouldn't be contacted using the TSIG key
`fookey`. The problem is the same the for `tls` property.

The reason of the problem was that when `named_config_getipandkeylist()`
reached a named server-list (here, `foo`), it modified the current
context in order to immediately process what is inside `foo`, but forgot
to look at the fields `key` and `tls`, to associate those with `foo`
addresses.

Fix the problem by wrapping the `key` and `tls` from the "caller" list
inside the existing `lists` struct which is used to figure out if a
list is already processed or not. That way, the `key` and `tls` values
can be read when adding the addresses of the nested list.

6 months agoremove `dns_notify_dequeue`
Colin Vidal [Tue, 25 Nov 2025 09:15:51 +0000 (10:15 +0100)] 
remove `dns_notify_dequeue`

Function `dns_notify_dequeue` is dead code, removing it.

6 months agotest named remote-servers `key` usage
Colin Vidal [Fri, 21 Nov 2025 16:05:15 +0000 (17:05 +0100)] 
test named remote-servers `key` usage

Even though `remote-servers` now allows using named server-list with `key`
(or `tls`), the `key` or `tls` is not used, in the context of a named
server-list, when configuring the server.

For instance,

   remote-servers foo { 10.53.0.5; };
   also-notify { foo key fookey; };

won't use `fookey`.

Add a system test highlighting the problem.

6 months agoallow named remote-servers list with key or tls
Colin Vidal [Wed, 19 Nov 2025 16:34:16 +0000 (17:34 +0100)] 
allow named remote-servers list with key or tls

The remote-servers clause enables the following pattern:

remote-servers a { 1.2.3.4; ... };
remote-servers b { a key foo; };

However, `check.c` was explicitly throwing an error if a `key` or `tls`
was provided after a named server-list. Remove this check, as this is a
valid use case.

6 months agofix: usr: Fix TLS contexts cache object usage bug in the resolver
Arаm Sаrgsyаn [Thu, 27 Nov 2025 17:41:17 +0000 (17:41 +0000)] 
fix: usr: Fix TLS contexts cache object usage bug in the resolver

:iscman:`named` could terminate unexpectedly when reconfiguring or
reloading, and if client-side TLS transport was in use (for example,
when forwarding queries to a DoT server). This has been fixed.

Closes #5653

Merge branch '5653-tlsctx_cache-reference-bug-fix' into 'main'

See merge request isc-projects/bind9!11295

6 months agoFix a bug where tlsctx_cache could be destroyed while still in use
Aram Sargsyan [Thu, 27 Nov 2025 15:00:26 +0000 (15:00 +0000)] 
Fix a bug where tlsctx_cache could be destroyed while still in use

When named is being reconfigured, it detaches from the old
'isc_tlsctx_cache_t' TLS context cache object and creates a
new one. This can cause an assertion failure within the
resolver when the object is destroyed while still in use,
because the resolver is using the object without getting
attached to it.

Add an attach/detach so that the 'isc_tlsctx_cache_t' doesn't
get destroyed while still being in use.

6 months agofix: usr: Fix the spurious timeouts while resolving names
Ondřej Surý [Thu, 27 Nov 2025 16:34:42 +0000 (17:34 +0100)] 
fix: usr: Fix the spurious timeouts while resolving names

Sometimes the loops in the resolving (e.g. to resolve or validate ns1.example.com we need to resolve ns1.example.com) were not properly detected leading to spurious 10 seconds delay.  This has been fixed and such loops are properly detected.

Closes #3033, #5578

Merge branch '5578-tracker-parent-fetch' into 'main'

See merge request isc-projects/bind9!11138

6 months agoDetect resolution loops between fetches
Ondřej Surý [Wed, 22 Oct 2025 17:25:55 +0000 (19:25 +0200)] 
Detect resolution loops between fetches

Maintain the relationship between the parent and child fetch and when
creating a new child fetch, properly check the resolution loops that
would lead to a new fetch would join one of the parent's fetch contexts.

6 months agochg: usr: Change the QNAME minimization algorithm to follow the standard
Ondřej Surý [Thu, 27 Nov 2025 16:34:07 +0000 (17:34 +0100)] 
chg: usr: Change the QNAME minimization algorithm to follow the standard

In !9155, the QNAME minimization was changed to not leak the query type
to the parent name server.  This violates RFC 9156 Section 3, step (3)
and it is not necessary.  It also breaks some (weird) authoritative DNS
setups, especially when CNAMEs are involved.  Also there is really no
privacy leak with query type.

Closes #5661

Merge branch '5661-dont-minimize-when-QNAME-matches-original-QNAME' into 'main'

See merge request isc-projects/bind9!11293

6 months agoChange the QNAME minimization algorithm to follow the standard
Ondřej Surý [Thu, 27 Nov 2025 13:07:35 +0000 (14:07 +0100)] 
Change the QNAME minimization algorithm to follow the standard

In !9155, the QNAME minimization was changed to not leak the query type
to the parent name server.  This violates RFC 9156 Section 3, step (3)
and it is not necessary.  It also breaks some (weird) authoritative DNS
setups, especially when CNAMEs are involved.  Also there is really no
privacy leak with query type.

6 months agonew: ci: Add Fedora 43
Michal Nowak [Thu, 27 Nov 2025 15:35:22 +0000 (16:35 +0100)] 
new: ci: Add Fedora 43

Merge branch 'mnowak/fedora-43' into 'main'

See merge request isc-projects/bind9!11285

6 months agoAdd Fedora 43
Michal Nowak [Wed, 17 Sep 2025 08:43:55 +0000 (10:43 +0200)] 
Add Fedora 43

6 months agonew: test: Create trust anchors from isctest.kasp.Key
Nicki Křížek [Thu, 27 Nov 2025 13:49:01 +0000 (14:49 +0100)] 
new: test: Create trust anchors from isctest.kasp.Key

Add isctest.kasp.Key.into_ta() method which convert the key into DS /
DNSKEY trust anchor for BIND config. Add a shared template
trusted.conf.j2 which can be linked to in tests to create the trust
anchor configuration from trust anchor data returned from bootstrap()
function.

This is basically a python replacement for the keyfile_to_static_ds (and
friends) from the conf.sh shell framework.

Merge branch 'nicki/pytest-add-trust-anchor-template' into 'main'

See merge request isc-projects/bind9!11201

6 months agoMock DSDigest for compatibility with older dnspython
Nicki Křížek [Thu, 27 Nov 2025 12:16:26 +0000 (13:16 +0100)] 
Mock DSDigest for compatibility with older dnspython

DSDigest class isn't available prior to dnspython 2.0.0 and prior to Add
an isctest.compat.DSDigest compatibility hack to support those versions.

6 months agoAdd a template for TA and generate it from isctest.kasp.Key
Nicki Křížek [Mon, 3 Nov 2025 13:59:00 +0000 (14:59 +0100)] 
Add a template for TA and generate it from isctest.kasp.Key

Add isctest.kasp.Key.into_ta() method which convert the key into DS /
DNSKEY trust anchor for BIND config. Add a shared template
trusted.conf.j2 which can be linked to in tests to create the trust
anchor configuration from trust anchor data returned from bootstrap()
function.

This is basically a python replacement for the keyfile_to_static_ds (and
friends) from the conf.sh shell framework.

6 months agoParse DNSKEY into a dnspython type in isctest.kasp.Key.dnskey
Nicki Křížek [Fri, 24 Oct 2025 14:47:59 +0000 (16:47 +0200)] 
Parse DNSKEY into a dnspython type in isctest.kasp.Key.dnskey

Previously, a DNSKEY string from keyfile was returned. This made the
function brittle for further processing, as the string would have to be
split up, concatenated, and TTL could be missing, making string indices
context-dependent.

Parse the DNSKEY rrset into a proper dnspython object and return it.
This makes the output more predictable and reliable, as all the
neccessary parsing is done by dnspython.

6 months agofix: dev: Add support for more linkers with LTO
Alessio Podda [Thu, 27 Nov 2025 12:36:57 +0000 (12:36 +0000)] 
fix: dev: Add support for more linkers with LTO

Link-time optimization requires close coordination between the compiler
and the linker, so not all combinations of compiler and linker support
it.

Previously, when compiling with Clang, we checked only for lld. With
this commit, we expand the list of supported linkers we check for.

Closes #5536

Merge branch '5536-more-supported-linker-ids' into 'main'

See merge request isc-projects/bind9!11022

6 months agoAdd auto LTO option
Alessio Podda [Tue, 30 Sep 2025 10:16:53 +0000 (12:16 +0200)] 
Add auto LTO option

Add an auto option to named-lto that disables weird setups like clang +
ld.bfd.

6 months agoRename -Dnamed-lto=off to -Dnamed-lto=disabled
Alessio Podda [Tue, 30 Sep 2025 07:19:00 +0000 (09:19 +0200)] 
Rename -Dnamed-lto=off to -Dnamed-lto=disabled

Meson boolean options are usually configured with enabled/disabled
instead of on/off. Make things more consistent with other meson options
by renaming -Dnamed-lto=off to -Dnamed-lto=disabled.

6 months agoAdd support for more linkers with LTO
Alessio Podda [Mon, 29 Sep 2025 06:20:00 +0000 (08:20 +0200)] 
Add support for more linkers with LTO

Link-time optimization requires close coordination between the compiler
and the linker, so not all combinations of compiler and linker support
it.

Previously, when compiling with Clang, we checked only for lld. With
this commit, we expand the list of supported linkers we check for.

6 months agochg: dev: Use malloc_usable_size()/malloc_size() for memory accounting
Ondřej Surý [Thu, 27 Nov 2025 11:42:09 +0000 (12:42 +0100)] 
chg: dev: Use malloc_usable_size()/malloc_size() for memory accounting

Restore usage of malloc_usable_size()/malloc_size(), but this time only
for memory accounting and statistics purposes.  This should reduce the
memory footprint in case of compilation without jemalloc as we don't
have to keep track of the allocated memory size ourselves.

Merge branch 'ondrej/use-malloc_usable_size-when-available' into 'main'

See merge request isc-projects/bind9!11271

6 months agoUse malloc_usable_size()/malloc_size() for memory accounting
Ondřej Surý [Mon, 24 Nov 2025 08:41:31 +0000 (09:41 +0100)] 
Use malloc_usable_size()/malloc_size() for memory accounting

Restore usage of malloc_usable_size()/malloc_size(), but this time only
for memory accounting and statistics purposes.  This should reduce the
memory footprint in case of compilation without jemalloc as we don't
have to keep track of the allocated memory size ourselves.

6 months agorem: dev: Remove internal memory filling in favor of jemalloc opt.junk
Ondřej Surý [Thu, 27 Nov 2025 09:40:28 +0000 (10:40 +0100)] 
rem: dev: Remove internal memory filling in favor of jemalloc opt.junk

Instead of having our own implementation of memory junk filling, rely on
the jemalloc opt.junk feature (set with MALLOC_CONF="junk:true").

Merge branch 'ondrej/remove-memfill' into 'main'

See merge request isc-projects/bind9!11270

6 months agoEnable junk filling via jemalloc option in the CI
Ondřej Surý [Wed, 26 Nov 2025 10:45:03 +0000 (11:45 +0100)] 
Enable junk filling via jemalloc option in the CI

Since the filling memory with junk patterns have been removed from ISC
memory context in favor of jemalloc opt.junk option, enable the jemalloc
behaviour by default in the GitLab CI.

6 months agoRemove internal memory filling in favor of jemalloc opt.junk
Ondřej Surý [Mon, 24 Nov 2025 08:32:51 +0000 (09:32 +0100)] 
Remove internal memory filling in favor of jemalloc opt.junk

Instead of having our own implementation of memory junk filling, rely on
the jemalloc opt.junk feature (set with MALLOC_CONF="junk:true").

6 months agochg: nil: Add optional debugging output for fetch context reference counting
Ondřej Surý [Thu, 27 Nov 2025 09:39:37 +0000 (10:39 +0100)] 
chg: nil: Add optional debugging output for fetch context reference counting

As the fetch context reference counting was converted to userspace RCU
reference counting, the ability to debug the reference counting was
lost.  Restore the debugging by adding the optional compile-time enabled
debugging output again.

Merge branch 'ondrej/add-tracing-to-fctx-reference-counting' into 'main'

See merge request isc-projects/bind9!11230

6 months agoAdd optional debugging output for fetch context reference counting
Ondřej Surý [Thu, 23 Oct 2025 11:11:45 +0000 (13:11 +0200)] 
Add optional debugging output for fetch context reference counting

As the fetch context reference counting was converted to userspace RCU
reference counting, the ability to debug the reference counting was
lost.  Restore the debugging by adding the optional compile-time enabled
debugging output again.

6 months agochg: nil: Split qctx_destroy() into qctx_deinit() and qctx_destroy()
Ondřej Surý [Thu, 27 Nov 2025 09:38:58 +0000 (10:38 +0100)] 
chg: nil: Split qctx_destroy() into qctx_deinit() and qctx_destroy()

The qctx_destroy() only needs to be called on allocated memory and
qctx_deinit() needs to be called always.  Also remove .allocated member
from the query_ctx_t structure.

Merge branch 'ondrej/add-qctx-deinit' into 'main'

See merge request isc-projects/bind9!11273

6 months agoSplit qctx_destroy() into qctx_deinit() and qctx_destroy()
Ondřej Surý [Mon, 24 Nov 2025 09:49:18 +0000 (10:49 +0100)] 
Split qctx_destroy() into qctx_deinit() and qctx_destroy()

The qctx_destroy() only needs to be called on allocated memory and
qctx_deinit() needs to be called always.  Also remove .allocated member
from the query_ctx_t structure.

6 months agofix: nil: Remove .delegating flag from the qpcache
Ondřej Surý [Thu, 27 Nov 2025 09:37:36 +0000 (10:37 +0100)] 
fix: nil: Remove .delegating flag from the qpcache

The .delegating flag was only set, but never used in the dns_qpcache.
Remove it completely together with the code that was locking the node
to set the flag if the added type was DNAME.

Merge branch 'ondrej/remove-delegating-from-qpcache' into 'main'

See merge request isc-projects/bind9!10980

6 months agoRemove .delegating flag from the qpcache
Ondřej Surý [Tue, 16 Sep 2025 13:09:14 +0000 (15:09 +0200)] 
Remove .delegating flag from the qpcache

The .delegating flag was only set, but never used in the dns_qpcache.
Remove it completely together with the code that was locking the node
to set the flag if the added type was DNAME.

6 months agochg: dev: Use atomics for CMM_{LOAD,STORE}_SHARED with ThreadSanitizer
Ondřej Surý [Thu, 27 Nov 2025 09:31:57 +0000 (10:31 +0100)] 
chg: dev: Use atomics for CMM_{LOAD,STORE}_SHARED with ThreadSanitizer

Upstream has removed the atomics implementation of CMM_LOAD_SHARED and
CMM_STORE_SHARED as these can be used also with non-stdatomics types.
As we only use the CMM api with stdatomics types, we can restore the
previous behaviour to prevent ThreadSanitizer warnings.

Closes #5660

Merge branch '5660-use-atomics-for-CMM-api-with-thread-sanitizer' into 'main'

See merge request isc-projects/bind9!11288

6 months agoUse atomics for CMM_{LOAD,STORE}_SHARED with ThreadSanitizer
Ondřej Surý [Wed, 26 Nov 2025 16:10:37 +0000 (17:10 +0100)] 
Use atomics for CMM_{LOAD,STORE}_SHARED with ThreadSanitizer

Upstream has removed the atomics implementation of CMM_LOAD_SHARED and
CMM_STORE_SHARED as these can be used also with non-stdatomics types.
As we only use the CMM api with stdatomics types, we can restore the
previous behaviour to prevent ThreadSanitizer warnings.

6 months agochg: ci: Fix wiki.wireshark.org links in doc/arm
Andoni Duarte [Wed, 26 Nov 2025 14:06:24 +0000 (14:06 +0000)] 
chg: ci: Fix wiki.wireshark.org links in doc/arm

Fix the broken link https://wiki.wireshark.org/TLS#tls-decryption to
simply https://wiki.wireshark.org/TLS. The links in the wireshark
wiki have been updated somewhen after october 2025 as shown by
https://web.archive.org/web/20251008165051/https://wiki.wireshark.org/TLS#tls-decryption and https://wiki.wireshark.org/TLS.

Merge branch 'andoni/fix-wireshark-links-in-doc-arm' into 'main'

See merge request isc-projects/bind9!11284

6 months agoUpdate wiki.wireshark.org link in doc/arm
Andoni Duarte Pintado [Wed, 26 Nov 2025 09:59:04 +0000 (10:59 +0100)] 
Update wiki.wireshark.org link in doc/arm

Fix the broken link https://wiki.wireshark.org/TLS#tls-decryption.
Since their TOC also has the wrong anchor, we remove it altogether,
i.e. https://wiki.wireshark.org/TLS.

6 months agochg: ci: Adjust respdiff threshold
Nicki Křížek [Tue, 25 Nov 2025 14:51:21 +0000 (15:51 +0100)] 
chg: ci: Adjust respdiff threshold

Closes #5649

Merge branch 'nicki/respdiff-threshold' into 'main'

See merge request isc-projects/bind9!11262

6 months agoIncrease the threshold for respdiff-third-party
Nicki Křížek [Fri, 21 Nov 2025 14:05:36 +0000 (15:05 +0100)] 
Increase the threshold for respdiff-third-party

There are multiple reasons for the increased amount of differences we've
been seeing lately and for the raise of the threshold:

1. Recent hardening against cache poisoning (CVE-2025-40778) have
   uncovered a few edge cases where the domain can't be properly
   resolved with the new protections in place, but those are issues with
   upstream configuration and DNS setup.
2. The same hardening magnified some behaviour differences between 9.21
   and older versions. Some misconfigured domains, which can be resolved
   with BIND 9.20 and older are no longer resolvable in 9.21+. This can
   be again attributed to upstream DNS misconfiguration. See #5649.
3. A change in the respdiff CI job to include timeouts in the
   comparison, or rather, increasing the timeouts to resolve the
   previously timed out queries, which are typically failures. With the
   previous job configuration, those were omitted from comparison,
   because they were timeouts. Now, there should be no timeouts, but
   there is a slight increase in the amount of differences for the
   threshold evaluation.

6 months agoSet stricter respdiff:recent-named threshold
Nicki Křížek [Fri, 21 Nov 2025 13:35:57 +0000 (14:35 +0100)] 
Set stricter respdiff:recent-named threshold

This job is testing the current BIND implementation against the latest
released version. Unless there has been a behaviour change, there should
be no difference.

In practice, there is a small number of differences caused by upstream
discrepencies. Some of those cause "upstream unstable" answers which are
excluded from the results, but statistically, some of those will end up
being detected as differences on the resolver under test.

Currently, there seems to be about 300 upstream unstable answers with
typically around 50-60 differences. Setting the threshold to 0.1 should
be stable enough to pass if there are no changes, yet sensitive enough
to detect even fairly small changes to behaviour.

6 months agochg: test: Disable 'doh' unit test on Enterprise Linux 8
Michal Nowak [Tue, 25 Nov 2025 12:29:26 +0000 (13:29 +0100)] 
chg: test: Disable 'doh' unit test on Enterprise Linux 8

Disable test that fails for months on this platform.

Closes #5448

Merge branch '5448-disable-doh-unit-test-on-el8' into 'main'

See merge request isc-projects/bind9!11276

6 months agoDisable 'doh' unit test on Enterprise Linux 8
Michal Nowak [Tue, 25 Nov 2025 09:53:17 +0000 (10:53 +0100)] 
Disable 'doh' unit test on Enterprise Linux 8

Disable test that fails for months on this platform.

6 months agofix: nil: Restore recording ns_statscounter_edns0out
Mark Andrews [Tue, 25 Nov 2025 04:05:11 +0000 (15:05 +1100)] 
fix: nil: Restore recording ns_statscounter_edns0out

Change d5e4684b3defdd79fe4b366c2da88bdcd7a4c5d9 accidentally caused
ns_statscounter_edns0out to no longer be incremented.  This has been
corrected.

Closes #5654

Merge branch '5654-restore-recording-ns_statscounter_edns0out' into 'main'

See merge request isc-projects/bind9!11267

6 months agoCheck nsstats statistics in bind9.xml
Mark Andrews [Mon, 24 Nov 2025 01:42:01 +0000 (12:42 +1100)] 
Check nsstats statistics in bind9.xml

6 months agoRestore recording ns_statscounter_edns0out
Mark Andrews [Mon, 24 Nov 2025 00:33:30 +0000 (11:33 +1100)] 
Restore recording ns_statscounter_edns0out

Change d5e4684b accidentally caused ns_statscounter_edns0out to no
longer be incremented.  This has been corrected.

6 months agofix: usr: Fix bug where zone switches from NSEC3 to NSEC after retransfer
Matthijs Mekking [Mon, 24 Nov 2025 13:23:21 +0000 (13:23 +0000)] 
fix: usr: Fix bug where zone switches from NSEC3 to NSEC after retransfer

When a zone is re-transferred, but the zone journal on an inline-signing secondary is out of sync, the zone could fall back to using NSEC records instead of NSEC3. This has been fixed.

Closes #5527

Merge branch '5527-retransfer-nsec3-bug' into 'main'

See merge request isc-projects/bind9!11226

6 months agoSkip private records when syncing secure db
Matthijs Mekking [Fri, 7 Nov 2025 14:56:54 +0000 (15:56 +0100)] 
Skip private records when syncing secure db

When synchronizing the secure database, we skip DNSSEC records that
BIND 9 maintains with inline-signing. We should also skip private
RDATA type records that are used to track the current state of a
zone-signing process.

6 months agoTest retransfer with NSEC3 policy
Matthijs Mekking [Thu, 6 Nov 2025 16:32:51 +0000 (17:32 +0100)] 
Test retransfer with NSEC3 policy

If the primary has been updated, but the secondary has not been
notified, the journal will go out of date. An 'rndc retransfer' causes
the zone to force an AXFR, removing and rebuilding zone and journal
files.

This test reproduces a bug that in such scenario, an NSEC3 signed zone
falls back to NSEC.

6 months agofix: nil: Do not log no root hints of _bind chaos view
Colin Vidal [Sat, 22 Nov 2025 03:51:30 +0000 (04:51 +0100)] 
fix: nil: Do not log no root hints of _bind chaos view

The "no root hints for view X" message must not be shown for the default
_bind/CH view. However, it is shown since 27c4f68dcc1 (part of effective
configuration changes).

The reason is that since 27c4f68dcc1, `configure_views()` now processes
a single list of views, which contains both builtin and user views as
they are both part of the effective configuration. The changes omit the
(now removed, since 6b5f714e53) `need_hints` bool that was disabling the
warning for the builtin view (_bind/CH).

This disable that log again when configuring _bind/CH view.

Merge branch 'colin/nohintswarn-bindchaos' into 'main'

See merge request isc-projects/bind9!11264

6 months agodo not log "no root hints for view '_bind'"
Colin Vidal [Fri, 21 Nov 2025 14:07:54 +0000 (15:07 +0100)] 
do not log "no root hints for view '_bind'"

The "no root hints for view X" message must not be shown for the default
_bind/CH view. However, it is shown since 27c4f68dcc1 (part of effective
configuration changes).

The reason is that since 27c4f68dcc1, `configure_views()` now processes
a single list of views, which contains both builtin and user views as
they are both part of the effective configuration. Those changes omitted
the `need_hints` bool that disabled the warning for the builtin view.
This commit silences the log message again.

6 months agochg: dev: add dns_message functions to set EDNS options
Evan Hunt [Fri, 21 Nov 2025 21:18:25 +0000 (21:18 +0000)] 
chg: dev: add dns_message functions to set EDNS options

The new `dns_message_ednsinit()` and `dns_message_ednsaddopt()` functions
allow EDNS options to be added to a message one at a time; it is no
longer necessary to construct a full array of EDNS options and set
them all at once.

This allows us to simplify EDNS option handling code, and in the
future it wlil allow plugins to add EDNS options to existing
messages.

Merge branch 'each-refactor-message-edns' into 'main'

See merge request isc-projects/bind9!11261

6 months agoremove dns_message_buildopt
Evan Hunt [Fri, 21 Nov 2025 07:33:29 +0000 (23:33 -0800)] 
remove dns_message_buildopt

now that the EDNS state is stored within dns_message_t, it's no longer
necessary to have a public API call to build an opt rdataset; we can
just have dns_message_setopt() build the opt record internally.

6 months agoadd dns_message API to add EDNS options
Evan Hunt [Wed, 19 Nov 2025 07:29:12 +0000 (23:29 -0800)] 
add dns_message API to add EDNS options

The new dns_message_ednsinit() and dns_message_ednsaddopt() functions
allow EDNS options to be added to a message one at a time; it is no
longer necessary to construct a full array of EDNS options and set
them all at once.

This allows us to simplify EDNS option handling code, and in the
future it wlil allow plugins to add EDNS options to existing
messages.

6 months agochg: test: Rewrite nsec3 system test to pytest
Matthijs Mekking [Fri, 21 Nov 2025 14:03:05 +0000 (14:03 +0000)] 
chg: test: Rewrite nsec3 system test to pytest

Merge branch 'matthijs-pytestify-nsec3' into 'main'

See merge request isc-projects/bind9!11030

6 months agoWait longer before keymgr is done
Matthijs Mekking [Fri, 21 Nov 2025 08:49:18 +0000 (09:49 +0100)] 
Wait longer before keymgr is done

To check if the key managing for a zone is done, we check a log message.
On some machines, with many zones this may take some time.

Increate the timeout to a minute. Note that most zones will continue
their test case much faster, but with many zones there may be some
straggling.

6 months agoWait until zones are signed before reconfig
Matthijs Mekking [Fri, 21 Nov 2025 08:47:08 +0000 (09:47 +0100)] 
Wait until zones are signed before reconfig

In order to make the tests run reliable, first make sure the key
managing for all the zones has finished before doing running the
reconfig command.

6 months agoOnly render required zones in config for nsec3 tests
Nicki Křížek [Thu, 20 Nov 2025 17:09:58 +0000 (18:09 +0100)] 
Only render required zones in config for nsec3 tests

When all zones are configured, regardless of whether the test module
actually uses them, it makes debugging the logs needlessly more
complicated, as there is a bunch of stuff going on that is completely
unrelated to the test.

Define a list of tested zones in each test module and only render the
named.conf with those zones defined.

6 months agoMove nsec3-change.kasp test to separate module
Matthijs Mekking [Fri, 14 Nov 2025 15:31:42 +0000 (16:31 +0100)] 
Move nsec3-change.kasp test to separate module

This zone has a specific corner case to be tested during the setup.
Move it to a separate module so it is less convoluted.

6 months agoMove check_nsec3_case to common code
Matthijs Mekking [Thu, 13 Nov 2025 18:54:03 +0000 (19:54 +0100)] 
Move check_nsec3_case to common code

With the nsec and nsec3 test cases being nearly identical for all
modules, these can be be unified and moved to common.py.

6 months agoClean up shell tests remnants
Matthijs Mekking [Tue, 30 Sep 2025 13:12:45 +0000 (15:12 +0200)] 
Clean up shell tests remnants

Now that all tests are covered by pytest, we can remove the remnants
of the shell test script.

6 months agoRewrite nsec3 system test to pytest (4/4)
Matthijs Mekking [Tue, 30 Sep 2025 13:11:22 +0000 (15:11 +0200)] 
Rewrite nsec3 system test to pytest (4/4)

Convert the final nsec3 system test case that deals with empty
non-terminals. This is a regression test case for GL #5108.

6 months agoRewrite nsec3 system test to pytest (3/4)
Matthijs Mekking [Tue, 30 Sep 2025 13:06:45 +0000 (15:06 +0200)] 
Rewrite nsec3 system test to pytest (3/4)

This converts two test cases:

1. A zone that previously failed to load is now fixed. Make sure the
   zone is signed correctly with the right NSEC3 parameters.

2. Test case to ensure the salt is the same after a restart, i.e. no
   re-salting takes place. Previously we only tested with salt length
   0, this commit adds a test case for salt length 8 as well.

6 months agoRewrite nsec3 system test to pytest (2/4)
Matthijs Mekking [Tue, 30 Sep 2025 11:25:22 +0000 (13:25 +0200)] 
Rewrite nsec3 system test to pytest (2/4)

This converts the nsec3 system test cases after to reconfiguring the
name server.

Two extra test for nsec3-change.kasp is updated. It depends on the
zone being updated, and a reconfig. This test code is moved to
tests_nsec3_reconfig.py.

Furthermore, an additional 'rndc signing -nsec3param' error test
case has been added.

6 months agoImprove check_auth_nsec3 salt checking
Matthijs Mekking [Tue, 30 Sep 2025 10:33:14 +0000 (12:33 +0200)] 
Improve check_auth_nsec3 salt checking

Since we know the salt after checking the NSEC3PARAM, we might as well
check the NSEC3 records on the NXDOMAIN response that the salt matches.

6 months agoMove parts into a common module
Matthijs Mekking [Tue, 30 Sep 2025 09:48:30 +0000 (11:48 +0200)] 
Move parts into a common module

Some constants and test functionality are the same for test cases
prior and after reconfiguration. Move these into a common module.

6 months agoConvert "in"-style templates to jinja
Matthijs Mekking [Tue, 30 Sep 2025 09:34:13 +0000 (11:34 +0200)] 
Convert "in"-style templates to jinja

Change the named.conf templating to make use of jinja template
rendering. The ns2 server is trivial. The ns3 server configuration
structure has changed:

The common configuration is moved out of named-fips.conf.

The main named.conf file is in named.conf.j2. It always includes the
common part, named-common.conf.j2, and the FIPS part,
named-fips.conf.j2.

The named-fips.conf.j2 and named-rsasha1.conf.j2 templates are
rendered differently depending on the reconfiged status. Mainly the
dnssec-policy for zones are different after reconfiguration, but there
are some other changes to, for example some zones change their
inline-signing setting.

Some zones only exist prior or after the configuration.

Finally, this is a bit hackish: If RSASHA1 is supported, named.conf
includes "named-rsasha1.conf", otherwise it includes the deliberately
empty "named-rsasha0.conf".

6 months agoRewrite nsec3 system test to pytest (1/4)
Matthijs Mekking [Tue, 30 Sep 2025 07:13:38 +0000 (09:13 +0200)] 
Rewrite nsec3 system test to pytest (1/4)

This converts all the nsec3 system test cases prior to reconfiguring the
name server. There are two main classes, one that tests the zone is
correctly signed with NSEC, the other with NSEC3.

Two extra tests for nsec3-dynamic-update-inline.kasp and
nsec3-change.kasp are also rewritten. For the former, we need to
change the 'nsupdate' definition to be able to set the expected RCODE.

6 months agofix: usr: Fix allow-recursion/allow-query-cache inheritance
Evan Hunt [Thu, 20 Nov 2025 20:19:52 +0000 (20:19 +0000)] 
fix: usr: Fix allow-recursion/allow-query-cache inheritance

The merging of the user options and defaults into the effective configuration broke the mutual inheritance of the `allow-recursion`, `allow-query`, and `allow-query-cache` ACLs, and of the `allow-recursion-on` and `allow-query-cache-on` ACLs. This has been fixed.

Closes #5647

Merge branch '5647-allow-recursion-inheritance' into 'main'

See merge request isc-projects/bind9!11254

6 months agofix ACL settings when merging views
Evan Hunt [Thu, 20 Nov 2025 06:09:53 +0000 (22:09 -0800)] 
fix ACL settings when merging views

when merging view objects into the effective configuration, add
allow-query-cache, allow-recursion, allow-query-cache-on and
allow-recursion-on ACLs as needed to reflect the way those
options inherit from each other.

this means the effective configuration is now correct for each
view.  ACLs no longer need to be corrected when applying the
configuration, and the actual effective ACL values will be
displayed in "rndc showconf" and "named-checkconf -pe".

6 months agofix allow-recursion/allow-query-cache inheritance
Evan Hunt [Thu, 20 Nov 2025 01:52:39 +0000 (17:52 -0800)] 
fix allow-recursion/allow-query-cache inheritance

the merging of options and defaults into the effective configuration
broke the mutual inheritance of the allow-recursion, allow-query, and
allow-query-cache ACLs, and of the allow-recursion-on and
allow-query-cache-on ACLs.

this has been corrected by adding a 'cloned' flag to the cfg_obj
structure to indicate whether it was configured explicitly or
cloned from the defaults during parsing. we can then adjust the
ACLs while configuring a view, favoring user-configured values
when they're available over cloned defaults.

currently the adjustments to the ACLs are done in configure_view();
later they'll be moved into the effective configuration and this
special handling can be removed.

6 months agoadd a test for allow-recursion/allow-query-cache inheritance
Evan Hunt [Thu, 20 Nov 2025 00:35:31 +0000 (16:35 -0800)] 
add a test for allow-recursion/allow-query-cache inheritance

allow-recursion is set to "none" in the options block and to
"any" in the view.  allow-query-cache in the view should inherit
the "any", not the "none". (currently this test does not pass.)

6 months agofix: dev: Attach socket before async streamdns_resume_processing
Colin Vidal [Thu, 20 Nov 2025 17:52:29 +0000 (18:52 +0100)] 
fix: dev: Attach socket before async streamdns_resume_processing

Call to `streamdns_resume_processing` is asynchronous but the socket
passed as argument is not attached when scheduling the call.

While there is no reproducible way (so far) to make the socket reference
number down to 0 before `streamdns_resume_processing` is called, attach
the socket before scheduling the call. This guard against an hypothetic
case where, for some reasons, the socket refcount would reach 0, and be
freed from memory when `streamdns_resume_processing` is called.

Closes #5620

Merge branch '5620-attach-socket-streamdns_resume_processing' into 'main'

See merge request isc-projects/bind9!11247

6 months agoattach socket before async streamdns_resume_processing
Colin Vidal [Tue, 18 Nov 2025 09:31:24 +0000 (10:31 +0100)] 
attach socket before async streamdns_resume_processing

Call to `streamdns_resume_processing` is asynchronous but the socket
passed as argument is not attached when scheduling the call.

While there is no reproducible way (so far) to make the socket reference
number down to 0 before `streamdns_resume_processing` is called, attach
the socket before scheduling the call. This guard against an hypothetic
case where, for some reasons, the socket refcount would reach 0, and be
freed from memory when `streamdns_resume_processing` is called.

6 months agochg: usr: Reduce the number of outgoing queries
Ondřej Surý [Thu, 20 Nov 2025 12:32:42 +0000 (13:32 +0100)] 
chg: usr: Reduce the number of outgoing queries

Reduces the number of outgoing queries when resolving the nameservers
for delegation points.  This helps the DNS resolver with cold cache
resolve client queries with complex delegation chains and redirections.

Merge branch 'ondrej/fctx_getaddresses' into 'main'

See merge request isc-projects/bind9!11148

6 months agoRefactor fctx_getaddresses() into couple smaller functions
Ondřej Surý [Wed, 19 Nov 2025 07:57:09 +0000 (08:57 +0100)] 
Refactor fctx_getaddresses() into couple smaller functions

The fctx_getaddresses() was lengthy and little bit confusing with
goto statements.  Split the single function into smaller parts:
one for forwarders, one for nameservers and one for alternates.

6 months agoReduce the number of outgoing queries
Ondřej Surý [Thu, 23 Oct 2025 11:11:45 +0000 (13:11 +0200)] 
Reduce the number of outgoing queries

The dns_resolver mode of operation is to resolve all the domains as it
iterates the DNS tree to fill up the cache as quickly as possible.

This commit reduces the number of outgoing queries by reducing the
number of remote fetches started for the nameserver addresses resolution
via dns_adb_createfind() to a smaller number per depth of the recursion
since the delegation point (3 2 1 0) - where 0 means only create fetch
on demand if we don't have any addresses yet.

6 months agofix: usr: AMTRELAY type 0 presentation format handling was wrong
Mark Andrews [Thu, 20 Nov 2025 08:46:10 +0000 (19:46 +1100)] 
fix: usr: AMTRELAY type 0 presentation format handling was wrong

RFC 8777 specifies a placeholder value of "." for the gateway field when the
gateway type is 0 (no gateway).  This was not being checked for nor emitted
when displaying the record. This has been corrected.

Instances of this record will need the placeholder period added to them when upgrading.

Closes #5639

Merge branch '5639-fix-atmrelay-type-0-support' into 'main'

See merge request isc-projects/bind9!11240

6 months agoAMTRELAY type 0 presentation format handling was wrong
Mark Andrews [Fri, 14 Nov 2025 01:59:29 +0000 (12:59 +1100)] 
AMTRELAY type 0 presentation format handling was wrong

RFC 8777 specifies a placeholder value of "." for the gateway field
when the gateway type is 0 (no gateway).

6 months agofix: dev: Fix building on OpenBSD 7.8 with Clang 19.1.7
Mark Andrews [Thu, 20 Nov 2025 02:40:11 +0000 (13:40 +1100)] 
fix: dev: Fix building on OpenBSD 7.8 with Clang 19.1.7

Add the OpenBSD and Clang combination to the existing kludge to
recognize size_t and uintXX_t types as same when using a generic.

Closes #5635

Merge branch '5635-openbsd-size_t-generics-fix' into 'main'

See merge request isc-projects/bind9!11235

6 months agoFix building on OpenBSD 7.8 with Clang 19.1.7
Aram Sargsyan [Tue, 11 Nov 2025 13:49:14 +0000 (13:49 +0000)] 
Fix building on OpenBSD 7.8 with Clang 19.1.7

Add the OpenBSD and Clang combination to the existing kludge to
recognize size_t and uintXX_t types as same when using a generic.

6 months agofix: nil: Remove install_rpath from synthrecord plugin
Ondřej Surý [Wed, 19 Nov 2025 22:07:39 +0000 (23:07 +0100)] 
fix: nil: Remove install_rpath from synthrecord plugin

See 0a56c71865f60127f1d0ce4c0b6408f747cde846 for more details.

Merge branch 'ondrej/remove-rpath-from-synthrecord' into 'main'

See merge request isc-projects/bind9!11253

6 months agoRemove install_rpath from synthrecord plugin
Ondřej Surý [Wed, 19 Nov 2025 21:07:30 +0000 (22:07 +0100)] 
Remove install_rpath from synthrecord plugin

See 0a56c71865f60127f1d0ce4c0b6408f747cde846 for more details.

6 months agoMerge tag 'v9.21.15'
Michal Nowak [Wed, 19 Nov 2025 17:38:37 +0000 (17:38 +0000)] 
Merge tag 'v9.21.15'

6 months agofix: test: Include <stdarg.h> in byaddr_test.c
Mark Andrews [Wed, 19 Nov 2025 00:56:16 +0000 (11:56 +1100)] 
fix: test: Include <stdarg.h> in byaddr_test.c

Closes #5637

Merge branch '5637-include-stdarg-h-in-byaddr-test-c' into 'main'

See merge request isc-projects/bind9!11241

6 months agoInclude <stdarg.h> in byaddr_test.c
Mark Andrews [Fri, 14 Nov 2025 02:34:45 +0000 (13:34 +1100)] 
Include <stdarg.h> in byaddr_test.c

6 months agochg: dev: Remove exclusive mode when scheduling zone load
Colin Vidal [Tue, 18 Nov 2025 11:16:39 +0000 (12:16 +0100)] 
chg: dev: Remove exclusive mode when scheduling zone load

Remove exclusive mode when scheduling the zone load, as it is no longer necessary;
data that can be read or written by multiple threads are locked or atomic.

The detection of the post zone DB loading logic has been refactored
to take into account the fact that zone databases may be loaded before the
function scheduling the loads.

Merge branch 'colin/remove-exclusive-zone-load' into 'main'

See merge request isc-projects/bind9!11231

6 months agorefactor detection of zone DB load completion
Colin Vidal [Mon, 10 Nov 2025 14:14:44 +0000 (15:14 +0100)] 
refactor detection of zone DB load completion

Because the asynchronous loading logic expected all jobs to be scheduled
then to be run (because it used to be scheduled during the exclusive
mode) and because all jobs are scheduled on various threads, there were
random situations where load_zones() would return after the scheduled
DB zone loading actually ran. In such cases, the zl->refs ref counter
in view_loaded() wouldn't go down to 0 and the remaining task to do
once all zones were loaded was never called. In particular,
server->reload_status kept the NAMED_RELOAD_PENDING state.

This problem is fixed by handling zoneload_t as a ref-counted object,
shared between load_zones() and each instance of scheduled zone DB
loading. Its destructor function is actually the content of
view_loaded() in the case the zt->refs went to 0. This ensures a
correct post-loading routine to be called once the last load is done.