]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 weeks agoRemove node and db pointer from dns_rdataset_t.vec
Alessio Podda [Mon, 2 Mar 2026 12:52:02 +0000 (13:52 +0100)] 
Remove node and db pointer from dns_rdataset_t.vec

Now that we track the references at the vecheader level, binding an
rdataset is no longer guaranteed to keep its node alive. Therefore
remove the node pointer from the rdataset, and instead decide whether
glue is required by explicitely passing the owner name to addglue.

6 weeks agoAdd hashmap to qpz_heap
Alessio Podda [Thu, 18 Dec 2025 00:37:53 +0000 (01:37 +0100)] 
Add hashmap to qpz_heap

This commit adds a level of indirection to the signing operations.
Instead of being intrusive, the qpz_heap will keep track of which
headers must be resigned through a hashmap.
The intent is to make dns_vecheader_t entirely self-contained. In
particular, the ownership structure between the heap and the headers is
flipped. Before, the headers would "own" the heap, now the heap owns
the header.

6 weeks agoRefactor setsigningtime
Alessio Podda [Wed, 17 Dec 2025 23:54:24 +0000 (00:54 +0100)] 
Refactor setsigningtime

Change setsigningtime to take the node of the header being changed.
Done to facilitate further refactoring that will remove the header
pointer from vecheader.

6 weeks agoExtract heap deregistration
Alessio Podda [Wed, 17 Dec 2025 23:54:48 +0000 (00:54 +0100)] 
Extract heap deregistration

This commit changes the deregistration of vecheaders from the heap to
go through a private api instead of the dyndb public one. This is safe
since vecheader is only used by qpzone.

This is done in order to facilitate further refactoring.

6 weeks agochg: nil: License test data files in REUSE.toml
Nicki Křížek [Tue, 31 Mar 2026 13:58:56 +0000 (15:58 +0200)] 
chg: nil: License test data files in REUSE.toml

In order to avoid the need to repeat the license header in named.conf
files and zone files, add the paths to REUSE.toml to assign the license.

Merge branch 'nicki/reuse-cover-configs-and-zones' into 'main'

See merge request isc-projects/bind9!11766

6 weeks agoRemove license header files from _common test files
Nicki Křížek [Mon, 30 Mar 2026 15:53:08 +0000 (17:53 +0200)] 
Remove license header files from _common test files

These are either config file or zone file snippets. Their license is
declared in REUSE.toml.

6 weeks agoLicense test data files in REUSE.toml
Nicki Křížek [Mon, 30 Mar 2026 15:52:14 +0000 (17:52 +0200)] 
License test data files in REUSE.toml

In order to avoid the need to repeat the license header in named.conf
files and zone files, add the paths to REUSE.toml to assign the license.

All shared snippets in bin/tests/system/_common and
bin/tests/system/**named.conf* files are covered.

Note that the existing rule **/**.db** already covers zone files. Only
remove the extraneous special-cases.

6 weeks agofix: dev: include <sys/endian.h> according by checking in meson
Aydın Mercan [Tue, 31 Mar 2026 13:07:05 +0000 (16:07 +0300)] 
fix: dev: include <sys/endian.h> according by checking in meson

The <sys/endian.h> header has existed in macOS since around ~26. This
causes the `htobeNN`/`htoleNN` macros to be redefined in <isc/endian.h>
in terms of <libkern/OSByteOrder.h> when other system headers include
<sys/endian.h>.

Fix this issue by using checking for the existence of <sys/endian.h> in
meson and including it according to the probe result.

Merge branch 'aydin/isc-endian-macos-fix' into 'main'

See merge request isc-projects/bind9!11751

6 weeks agoinclude <sys/endian.h> according by checking in meson
Aydın Mercan [Wed, 25 Mar 2026 13:28:48 +0000 (16:28 +0300)] 
include <sys/endian.h> according by checking in meson

The <sys/endian.h> header has existed in macOS since around ~26. This
causes the `htobeNN`/`htoleNN` macros to be redefined in <isc/endian.h>
in terms of <libkern/OSByteOrder.h> when other system headers include
<sys/endian.h>.

Fix this issue by using checking for the existence of <sys/endian.h> in
meson and including it according to the probe result.

6 weeks agoPrepare release notes for BIND 9.21.21
Michal Nowak [Tue, 31 Mar 2026 09:31:22 +0000 (11:31 +0200)] 
Prepare release notes for BIND 9.21.21

6 weeks agoGenerate changelog for BIND 9.21.21
Michal Nowak [Tue, 31 Mar 2026 09:29:32 +0000 (11:29 +0200)] 
Generate changelog for BIND 9.21.21

6 weeks agochg: doc: Set up version for BIND 9.21.22
Michal Nowak [Tue, 31 Mar 2026 08:16:09 +0000 (10:16 +0200)] 
chg: doc: Set up version for BIND 9.21.22

Merge branch 'mnowak/set-up-version-for-bind-9.21.22' into 'main'

See merge request isc-projects/bind9!11770

6 weeks agoUpdate BIND version to 9.21.22-dev
Michal Nowak [Tue, 31 Mar 2026 08:13:13 +0000 (10:13 +0200)] 
Update BIND version to 9.21.22-dev

6 weeks agochg: usr: Switch to LRU-only cache eviction, enforce minimum cache size
Ondřej Surý [Mon, 30 Mar 2026 20:29:17 +0000 (22:29 +0200)] 
chg: usr: Switch to LRU-only cache eviction, enforce minimum cache size

Busy resolvers will now gradually fill the configured :any:max-cache-size
before entries start being evicted. Previously, expired records were
proactively removed based on their TTL, which kept memory usage below the
configured limit but added overhead. Cache eviction now relies solely on the
SIEVE-LRU mechanism, which has matured to the point where TTL-based cleaning
is no longer necessary.

Setting :any:max-cache-size to unlimited or 0 is no longer supported
and falls back to the default (90% of physical memory).

Merge branch 'ondrej/no-ttl-based-cleaning' into 'main'

See merge request isc-projects/bind9!11459

6 weeks agoRemove the dead dns_expire_ttl code path and deletettl stats counter
Ondřej Surý [Mon, 30 Mar 2026 09:54:34 +0000 (11:54 +0200)] 
Remove the dead dns_expire_ttl code path and deletettl stats counter

Now that TTL-based cleaning has been removed, the dns_expire_ttl enum
value, its switch case in expireheader(), and the deletettl stats counter
(text, XML, JSON) are all dead code.  Remove them so the stats channel
no longer reports a permanently-zero counter.

6 weeks agoMove ADB TTL-based cleanup into dump_adb()
Ondřej Surý [Sat, 14 Mar 2026 08:45:05 +0000 (09:45 +0100)] 
Move ADB TTL-based cleanup into dump_adb()

Instead of doing a full sweep of all names and entries before dumping,
expire stale entries lazily as they are encountered during the dump
iteration.  This aligns with the QPcache approach of avoiding separate
TTL-based cleaning passes.

dns_adb_flush() retains its explicit full sweep since it needs to
force-expire everything.

6 weeks agoRaise the minimum cache size to 8 MB, warn below 256 MB
Ondřej Surý [Thu, 19 Feb 2026 09:24:13 +0000 (10:24 +0100)] 
Raise the minimum cache size to 8 MB, warn below 256 MB

Lower the hard floor for max-cache-size from 2 MB to 8 MB to support
resource-constrained environments (e.g. CPE devices) while remaining
safe for LRU-only eviction.

6 weeks agoRefactor the 'max-cache-size' configuration handling
Ondřej Surý [Thu, 19 Feb 2026 09:03:45 +0000 (10:03 +0100)] 
Refactor the 'max-cache-size' configuration handling

Extract the inline max-cache-size logic from configure_view() into
reusable helpers: configure_max_cache_size(), default_max_cache_size(),
max_cache_size_as_percent(), and sanitized_max_cache_size().

Move DNS_CACHE_MINSIZE and DNS_ADB_MINADBSIZE to public headers and
remove the SIZE_AS_PERCENT sentinel.

6 weeks agoRemove 'unlimited' setting for the max-cache-size
Ondřej Surý [Sat, 17 Jan 2026 08:56:31 +0000 (09:56 +0100)] 
Remove 'unlimited' setting for the max-cache-size

Since TTL-based cache cleaning has been removed, an unlimited
max-cache-size would eventually exhaust system memory.

Both 'max-cache-size unlimited;' and 'max-cache-size 0;' now fall
back to the default value (90% of physical memory for recursive
views).

6 weeks agoRemove the heap memory context from QPcache
Ondřej Surý [Wed, 14 Jan 2026 15:35:27 +0000 (16:35 +0100)] 
Remove the heap memory context from QPcache

The heaps have been removed, so the separate heap memory context
(hmctx) is no longer needed.  Remove it from both dns_cache and
dns_qpcache, along with the HeapMemInUse statistics.

6 weeks agoRemove TTL-based cleaning from the QPcache
Ondřej Surý [Wed, 14 Jan 2026 12:43:48 +0000 (13:43 +0100)] 
Remove TTL-based cleaning from the QPcache

The experiments show that the SIEVE-LRU based mechanism is good enough
as the only mechanism for cleaning up the expired entries from the
cache.

This simplifies the internal logic and memory usage of the cache.

The disadvantage is that the cache use will organically grow until it
hits the overmem cleaning mechanism.

The advantage is that the measurements show that BIND 9 is well behaved
even with 512 MB cache under heavy load.

6 weeks agoRemove useless .expire initialization from rdataslab
Ondřej Surý [Wed, 14 Jan 2026 12:17:30 +0000 (13:17 +0100)] 
Remove useless .expire initialization from rdataslab

dns_rdataslab_fromrdataset() set .expire to rdataset->ttl, but the
only consumer (qpcache_addrdataset) immediately overwrote it with
now + rdataset->ttl.  Remove the redundant initialization and set the
expire time only once.

6 weeks agochg: usr: Parent-centric resolver
Colin Vidal [Mon, 30 Mar 2026 19:45:03 +0000 (21:45 +0200)] 
chg: usr: Parent-centric resolver

The `named` resolver now uses a separate "delegation database" to store zone referral data instead of the DNS cache. This new database holds the NS RRset on the parent side of a zone cut, as well as necessary glue records that were included in the referral. The NS RRset from the child side is cached in the DNS cache and is not used for name resolution.

This will be a step toward simplifying resolver logic and also supporting DELEG referrals.

Closes #3311

Merge branch 'colin/deleg-resolver' into 'main'

See merge request isc-projects/bind9!11621

6 weeks agoresolver tests: set 3MB cache size
Colin Vidal [Mon, 30 Mar 2026 13:37:52 +0000 (15:37 +0200)] 
resolver tests: set 3MB cache size

The default max-cache-size on the system test being enforced to 2MB
(from the -T switch). It means the main cache size is 6/8 of it (1/8
being reserved for ADB and 1/8 for the delegation database).

However, the minimal cache size of the main cache is 2MB, which means
that the main cache size will actually be 2MB anyway when running the system tests.

This was breaking some resolver tests were failing because when the
cache was shared and named reload, the previous cache size was, indeed,
2MB whereas the newly requested size only 6/8 of it (that happened
before the size is bumped to the minimal value).

Set the ns1 of resolver tests max cache size of 3MB, so even 6/8 of the
max cache size is more than the minimum 2MB of the main cache size,
which enable to keep the shared cached between views for this test
between reloads.

6 weeks agocache memory adjustements
Colin Vidal [Mon, 30 Mar 2026 12:49:28 +0000 (14:49 +0200)] 
cache memory adjustements

The delegation DB now uses the same amount of memory than ADB, which is
1/8 of the `max-cache-size`.

The main cache database, instead of using `max-cache-size`, now use the
"remaining" part of it, after the delegation DB and ADB took their part,
so 6/8.

This avoid blowing up the host memory, typically when specifying
`max-cache-size 95%`, as the global cache usage would go way ahead 100%.

6 weeks agoAdd RPZ NSDNAME test
Colin Vidal [Fri, 27 Mar 2026 12:12:17 +0000 (13:12 +0100)] 
Add RPZ NSDNAME test

Add a simple case (i.e. not relying on zone being generated during the
test) ensuring that RPZ NSDNAME rules are correctly applied using the
parent-centric resolver.

6 weeks agotest for auth+res server and glues in delegation
Colin Vidal [Fri, 27 Mar 2026 15:00:25 +0000 (16:00 +0100)] 
test for auth+res server and glues in delegation

When a resolver+auth server has a delegation on a local zone and has a
glue, the glue can only be for in-domain NS.

In this case, when the resolver is looking at the zonecut,
`dns_view_bestzonecut()` synthesizes a delegset from an NS rdataset
found in the local zone (the delegation inside auth zone), and ignores
the glues if any.

As a result, the delegset will contain a single delegation of type
DNS_DELEGTYPE_NS_NAMES, which leads to an ADB fetch. But it's actually an
in-memory fetch, because in this case, the fetch will immediately find
the A/AAAA glues from the local zone.

An alternative approach (not chosen here) would be to make
`dns_view_bestzonecut()`, when converting an NS rdataset into a
`dns_deleg_t`, check for glues for the delegation in the auth zone, and
add those in the `dns_deleg_t`. The delegation would be of type
DNS_DELEGTYPE_NS_GLUES which would avoid the ADB name lookup.

However, that's extra code, extra logic and complexities, for a lookup
that will be done in memory anyway, just a bit later. So for now, this
is not implemented that way.

The test is added, however, to confirm that there is no attempt from the
resolver to get the NS fron the child zone.

6 weeks agoremove find_deepest_zonecut() from qpcache
Evan Hunt [Sat, 21 Mar 2026 04:45:29 +0000 (21:45 -0700)] 
remove find_deepest_zonecut() from qpcache

because the cache no longer stores delegation (parent-side) NS rrsets,
and authoritative (child-side) NS rrsets don't affect recursion,
it no longer makes sense for qpcache_find() to look for NS rrsets
and return DNS_R_DELEGATION. that code has been removed.

the cache still does search for covering DNAME records. the
check_zonecut() function has been renamed to check_dname() for clarity.

related changes:
- one test case has been removed from the mirror system test, because it
  tested the behavior of a cached delegation.
- query_checkrrl() and rpz_rrset_find() have been updated so they no
  longer expect cache responses to have DNS_R_DELEGATION response codes.

6 weeks agosystem test for rndc dumpdb -cache and reload
Colin Vidal [Tue, 24 Mar 2026 13:37:00 +0000 (14:37 +0100)] 
system test for rndc dumpdb -cache and reload

Add system test which check the behavior of `rndc dumpdb -cache` as well
as the preservation of the delegation cache on server reload.

6 weeks agoDump delegation database in 'rndc dumpdb'
Colin Vidal [Mon, 30 Mar 2026 09:22:32 +0000 (11:22 +0200)] 
Dump delegation database in 'rndc dumpdb'

When dumping the cache, include the contents of the delegation
database. Add a new 'rndc dumpdb -deleg' option, which dumps
the delegation database exclusively.

While the delegation database dumping format mimic the zone file format,
the API does not use the `dns_master_style_t` configuration (i.e. to
specify how many spaces/tab are used between each RR fields), because
the generic API handling this relies on databse using `dns_rdataset_t`
as internal storage format. This can be improved later.

6 weeks agoprevent early termination of rpzrecurse test
Evan Hunt [Thu, 19 Mar 2026 20:08:25 +0000 (13:08 -0700)] 
prevent early termination of rpzrecurse test

add "|| ret=1" after calls to dig, so that dig failures won't
stop the test due to "set -e".

6 weeks agoAdd invariant check for delegset in rctx_nextserver()
Ondřej Surý [Sat, 14 Mar 2026 09:10:34 +0000 (10:10 +0100)] 
Add invariant check for delegset in rctx_nextserver()

The get_nameservers path in rctx_nextserver() is only reachable from
rctx_referral(), which already detaches fctx->delegset.  Assert that
it is NULL rather than redundantly detaching it, since
dns_view_bestzonecut() requires *delegsetp == NULL.

6 weeks agoGuard against NULL delegset in query_delegation_recurse()
Ondřej Surý [Sat, 14 Mar 2026 07:20:43 +0000 (08:20 +0100)] 
Guard against NULL delegset in query_delegation_recurse()

If both dns_view_bestzonecut() and dns_deleg_fromrdataset() fail,
delegset stays NULL.  Passing it to ns_query_recurse() would crash
on the REQUIRE(DNS_DELEGSET_VALID(delegset)) in createfetch().

Return ISC_R_NOTFOUND instead, which lets the caller handle the
failure gracefully.

6 weeks agoClean up frdataset in resume_dslookup() on shutdown
Ondřej Surý [Sat, 14 Mar 2026 07:20:05 +0000 (08:20 +0100)] 
Clean up frdataset in resume_dslookup() on shutdown

When resume_dslookup() receives ISC_R_SHUTTINGDOWN or ISC_R_CANCELED,
frdataset (fctx->nsrrset) was not disassociated.  While fctx__destroy()
eventually cleans it up, leaving it associated keeps the underlying DB
node referenced longer than necessary.

6 weeks agoFix fetchlimit test failure
Evan Hunt [Tue, 3 Mar 2026 06:29:20 +0000 (22:29 -0800)] 
Fix fetchlimit test failure

When a referral lookup is triggered by a QMIN query, it should be
exempt from the fetches-per-zone limit just as the QMIN query itself
is.

Also restart the test server between the fetches-per-server and
fetches-per-zone tests so that leftover statistics from the former
do not pollute the latter.

Another fix is because zone spills and general query drops are no longer
in a strict >= relation (on a parent-centric resolver), so check that
both counters are non-zero instead.

6 weeks agoFix chain system test for parent-centric resolver
Evan Hunt [Tue, 3 Mar 2026 02:12:33 +0000 (18:12 -0800)] 
Fix chain system test for parent-centric resolver

The resolver now uses glue addresses from the parent side of a
zonecut without triggering an additional address lookup.  Update the
test involving a nameserver target name below a DNAME so that the
delegation does not use glue.

6 weeks agoDo not cache NS from referral in negative responses
Colin Vidal [Fri, 27 Feb 2026 16:07:31 +0000 (17:07 +0100)] 
Do not cache NS from referral in negative responses

Stop storing the NS referral into the main cache when processing a
negative response.  These records are already cached in the delegation
database and are not needed elsewhere.

Update dnssec tests that relied on parent-side NS RRsets being
returned in recursive query responses.

6 weeks agoCleans up `mark_related()`
Colin Vidal [Mon, 30 Mar 2026 09:49:29 +0000 (11:49 +0200)] 
Cleans up `mark_related()`

Cleans up mark_related(): since the FCTX_ATTR_GLUING flag is never set
anymore, the code that handled it has been removed.

6 weeks agoFix cacheclean system test for parent-centric resolver
Colin Vidal [Thu, 19 Feb 2026 15:56:10 +0000 (16:56 +0100)] 
Fix cacheclean system test for parent-centric resolver

The ADB flushtree test was failing because the test zone
(flushtest.example.) uses an in-domain nameserver with parent glue,
so the ADB cache was never populated.

Add a new zone with an out-of-domain nameserver to force an ADB
lookup and ensure the flushtree test exercises the intended code
path.

6 weeks agoWire delegdb flushing flows
Colin Vidal [Mon, 30 Mar 2026 09:36:10 +0000 (11:36 +0200)] 
Wire delegdb flushing flows

The 'rndc flush' and 'rndc flushname/flushtree' commands are now wired
to the delegation database, along with the main cache.

6 weeks agoUse delegdb for lookup in query_delegation_recurse()
Colin Vidal [Wed, 18 Feb 2026 15:05:19 +0000 (16:05 +0100)] 
Use delegdb for lookup in query_delegation_recurse()

When `query.c` finds a zonecut in the main cache (e.g. from stale NS
records), it must still use the correct delegation for recursion. Look
up the delegation DB via `dns_view_bestzonecut()` first; fall back to
`dns_deleg_fromrdataset()` only if no delegation is found.

This might also be done inside `query_lookup()` instead, with the `qctx`
holding a delegset property, but that approach needs further work to
avoid breakage and it is not clear so far if there would be other use
case of it. Current approach is simpler for now.

6 weeks agoSimplify resolver delegation expiry test
Colin Vidal [Wed, 18 Feb 2026 15:04:04 +0000 (16:04 +0100)] 
Simplify resolver delegation expiry test

Remove the dynamic NS update loop from the delegation expiry test.
With the delegation DB, it is sufficient to wait for the delegation
to expire (after 5 seconds) and verify that names below the removed
zone return NXDOMAIN.

6 weeks agoFix tests for parent-centric resolver behavior
Evan Hunt [Wed, 11 Feb 2026 21:56:59 +0000 (13:56 -0800)] 
Fix tests for parent-centric resolver behavior

In 'additional', pre-cache the A RRset for ns1.rt.example so the
additional-data handling in the cache can be tested; previously this
was cached as part of resolution, but now must be queried explicitly.

In 'cookie', pre-cache an NS to prevent a QMIN query from distorting
log results and causing a test failure.

In 'resolver', increase the expected query count in the timeout test.

6 weeks agoFix qmin test with parent-centric resolver
Colin Vidal [Wed, 11 Feb 2026 13:47:51 +0000 (14:47 +0100)] 
Fix qmin test with parent-centric resolver

Remove expected queries for ns2 addresses (and ns.b.stale.) from the
qmin system test.  The parent-centric resolver no longer attempts to
get the child-side NS of the delegation, so these queries do not
occur.

6 weeks agoupdate camp system test max-query-count
Colin Vidal [Tue, 10 Feb 2026 15:08:36 +0000 (16:08 +0100)] 
update camp system test max-query-count

As named is now parent-centric, the global query count can be lower (in
particular for queries which has a long delegation chain), as the
resolver doesn't proactively resolve an NS name when a glue is provided
by the parent-side of a zonecut.

Update camp system test to lower the max-query-count of ns9, to ensure
the max-query-count limit enforcement is still working.

6 weeks agoResolver is parent-centric
Colin Vidal [Mon, 30 Mar 2026 09:45:15 +0000 (11:45 +0200)] 
Resolver is parent-centric

The resolver now uses glue addresses from `dns_deleg_t` objects stored
in the delegation database.  The main cache is still used for ADB A/AAAA
lookups when no glue is available for a nameserver name.

The resolver's `fctx_getaddresses()` is refactored to, for each
delegation of the delegation set, try to get the address-based finds,
then nameserver name lookups. (Later, the logic to handle DELEG
`include-delegparm=` will be hooked there too.)

6 weeks agoAdd dns_adb_createaddrinfosfind() for address-based lookups
Colin Vidal [Sat, 28 Mar 2026 09:02:22 +0000 (10:02 +0100)] 
Add dns_adb_createaddrinfosfind() for address-based lookups

Add a new ADB API function that creates a find from a list of addresses
rather than by looking up nameserver names.  This enables the resolver
to handle address-based delegations (NS-based with glues or DELEG with
addresses) and name-based delegations uniformly (i.e. the list of finds
from ADB is handled the same way no matter the type of the delegation).

6 weeks agoAdd system test for minimal-responses behaviour
Colin Vidal [Mon, 23 Feb 2026 13:27:44 +0000 (14:27 +0100)] 
Add system test for minimal-responses behaviour

Add the 'minimalresponses' system test in order to cover the multiple
combinations of server 'minimal-responses' configurations and contexts
(resolver, auth only, etc.) when filling the ANSWER, AUTHORITY and
ADDITIONAL sections.

6 weeks agoMake the RD flag optional in isctest.query()
Evan Hunt [Tue, 24 Feb 2026 00:27:52 +0000 (16:27 -0800)] 
Make the RD flag optional in isctest.query()

Add an 'rd' parameter (default True) to isctest.query.create() so
that non-recursive queries can be sent with rd=False.

6 weeks agoRemove dns_db_findzonecut()
Evan Hunt [Fri, 20 Feb 2026 23:17:03 +0000 (15:17 -0800)] 
Remove dns_db_findzonecut()

This function is no longer used and has been removed, along with its
implementation in qpcache.

6 weeks agoDon't use dns_db_findzonecut() in query_addbestns()
Evan Hunt [Fri, 20 Feb 2026 22:55:42 +0000 (14:55 -0800)] 
Don't use dns_db_findzonecut() in query_addbestns()

Previously, when answering from the cache, and when minimal-responses
was not set, we added the best known zone cut to the authority section
of the response message, using dns_db_findzonecut() to look it up in
the DNS cache.  Since the DNS cache will no longer be used to store
parent-side NS RRsets, it will now be possible for an ancestor node
to be used as the zone cut, leading to the wrong NS record being
included.

There are various ways we could correct this:

1. Use dns_deleg_lookup() instead of dns_db_findzonecut() to find the
   zone cut. But currently, the deleg database stores only the server
   addresses for the delegation, not the full NS RRset; this would need
   to be changed.
2. Look up <name>/NS whenever we cache a referral; that way we'll get
   the child-side NS RRset and cache that, and we can retrieve it when
   building the response.

But the solution chosen here is simply not to look up the NS record
when answering from the cache, effectively making "minimal-responses
yes;" mandatory for queries answered from the cache.

System tests have been updated as needed, so they no longer expect
NS RRsets in the authority section of recursive responses.

6 weeks agoUse delegation DB for bestzonecut lookups
Colin Vidal [Mon, 30 Mar 2026 09:31:47 +0000 (11:31 +0200)] 
Use delegation DB for bestzonecut lookups

Function `dns_view_bestzonecut()` now uses the delegation DB instead of
the main cache when looking up at the cache.

As a result, replace `dns_rdataset_t` (representing an NS RRset) with
`dns_delegset_t` in `dns_view_bestzonecut()` and
`dns_resolver_createfetch()` APIs. The resolver and query processing now
use the delegation DB instead of the cache for zonecut lookups.

In the case of the delegation lives in the local database, the locally
found `rdataset` is internally converted into a `dns_delegset_t` object.
From caller POV, it doesn't change anything: a delegation set is a
read-only object which can be used as long as needed and must be
detached one it's done with it.

6 weeks agofix delv in resolver mode
Colin Vidal [Sat, 28 Mar 2026 12:59:26 +0000 (13:59 +0100)] 
fix delv in resolver mode

Create an instance of the delegation database in the view created by
delv in resolver mode. As the default `named` configuration is not in
use, also specifically configure the `max-delegation-servers` setting
using the same default value than `named`.

6 weeks agoPopulate the delegation DB from referrals answers
Colin Vidal [Thu, 22 Jan 2026 10:07:01 +0000 (11:07 +0100)] 
Populate the delegation DB from referrals answers

The resolver now caches NS records and their A/AAAA glues from referral
answers into the delegation database.

A new `cache_delegns()` function extracts NS names and associated glue
addresses from the authority/additional sections of a referral answer
and use those informations to build a delegation set, which is then
inserted into the delegation database.

The created delegation set contains a delegation per NS RR. If the NS RR
has matching A/AAAA RR, the delegation only store the addresses and not
the name. (Note this is technically possible to group all NS RR which
doesn't have glues into a single delegation, and the implementation can
be changed in that way in the future).

Each view has its own instance of the delegation database (they are
never shared between views), but a server restart/reload preserve the
delegation database state.

6 weeks agoIntroduce a delegation database
Colin Vidal [Tue, 20 Jan 2026 13:58:53 +0000 (14:58 +0100)] 
Introduce a delegation database

Add `dns_delegdb_t`, a qpmulti-based database enabling to lookup a
delegation set (`dns_delegset_t`) from a zonecut name (`dns_name_t`). A
delegation set object essentially contains an expiration time and a list
of delegation (`dns_deleg_t`). Finally, a delegation can be either:

- A list of IP addresses (`isc_netaddrlist_t`), for NS-based delegation
  providing glues or DELEG-based delegation using `server-ipv4=` or
  `server-ipv6=`;
- Or a list of nameserver names, for NS-based delegation without glues,
  or DELEG-based delegation using `server-name=`;
- Or a list of nameserver names, for DELEG-based delegation using
  `include-delegparam=`.

The delegation database API provides lookup by closest zonecut,
delegation and delegation set builders as well as insertion of those
newly built delegation set, dumping to a `FILE *`, conversion from an NS
rdataset to a delegation set, deletion of a specific zonecut or all the
sub-tree of a given zonecut.

A memory context is internally used inside the delegation database and
can be constraint to a maximum size. Once it gets close to its maximum
size and a new delegation set is inserted into the database, a
reclamation flow is run internally removing the least recently used
entries.

The delegation set and delegation objects are, once they been inserted
into the database, read-only object. Thus, the caller can use them
without concurrency or locking concerns, and must detached them once its
done with it.

6 weeks agoAdd ISC_LIST support for isc_netaddr_t
Colin Vidal [Tue, 20 Jan 2026 14:05:58 +0000 (15:05 +0100)] 
Add ISC_LIST support for isc_netaddr_t

Add an `isc_netaddrlink_t` type wrapping an `isc_netaddr_t` and an
`ISC_LINK`. This enable to build list of `isc_netaddr_t` without
increasing the memory footprint of existing usages of `isc_netaddr_t`
(which doesn't require to be linked).

6 weeks agochg: dev: Revert NTA flush on expire
Arаm Sаrgsyаn [Mon, 30 Mar 2026 18:27:59 +0000 (18:27 +0000)] 
chg: dev: Revert NTA flush on expire

Flushing the name when NTA expires causes problems for the ongoing
resolving process. Do not flush the name from the cache. Instead,
the resolver should do the flushing (this is planned to be implemented
later).

Merge branch 'aram/revert-nta-flush-on-expire' into 'main'

See merge request isc-projects/bind9!11765

6 weeks agoRevert NTA flush on expire
Aram Sargsyan [Mon, 30 Mar 2026 12:11:46 +0000 (12:11 +0000)] 
Revert NTA flush on expire

Flushing the name when NTA expires causes problems for the ongoing
resolving process. Do not flush the name from the cache. Instead,
the resolver should do the flushing (this is planned to be merged
next).

6 weeks agofix: usr: Count temporal problems with DNSSEC validation as attempts
Ondřej Surý [Mon, 30 Mar 2026 10:32:23 +0000 (12:32 +0200)] 
fix: usr: Count temporal problems with DNSSEC validation as attempts

After KeyTrap, the temporal DNSSEC were originally hard errors that
caused validation failures even if the records had another valid
signature.  This has been changed and the RRSIGs outside of the
inception and expiration time are not counted as hard errors.  However,
these errors are not even counted as validation attempts, so excessive
number of expired RRSIGs would cause some non-cryptograhic extra work
for the validator.  This has been fixed and the temporal errors are
correctly counted as validation attempts.

Closes #5760

Merge branch '5760-count-DNSSEC-temporal-errors-as-validation-attempts' into 'main'

See merge request isc-projects/bind9!11589

6 weeks agoCount temporal problems with DNSSEC validation as attempts
Ondřej Surý [Mon, 23 Feb 2026 18:42:49 +0000 (19:42 +0100)] 
Count temporal problems with DNSSEC validation as attempts

After KeyTrap, the temporal DNSSEC were originally hard errors that
caused validation failures even if the records had another valid
signature.  This has been changed and the RRSIGs outside of the
inception and expiration time are not counted as hard errors.  However,
these errors are not even counted as validation attempts, so excessive
number of expired RRSIGs would cause some non-cryptograhic extra work
for the validator.  This has been fixed and the temporal errors are
correctly counted as validation attempts.

6 weeks agofix: usr: Fix update-policy per-type max quota bypass via crafted UPDATE messages
Ondřej Surý [Sat, 28 Mar 2026 09:44:21 +0000 (10:44 +0100)] 
fix: usr: Fix update-policy per-type max quota bypass via crafted UPDATE messages

An authenticated DDNS client could bypass update-policy per-type record limits
(e.g. TXT(3)) by including padding records in the UPDATE message that are
silently skipped during processing. Each skipped record shifted an internal
counter, causing subsequent records to be checked against the wrong quota —
potentially reading an unlimited (0) entry instead of the configured maximum.

This allowed a client with valid TSIG credentials to add an arbitrary number of
records beyond the configured limit across repeated UPDATE messages up to the
`max-records-per-type` limit.

Closes #5799

Merge branch '5799-fix-counter-desync-in-SSU' into 'main'

See merge request isc-projects/bind9!11708

6 weeks agoFix update-policy per-type max quota bypass via counter desynchronization
Ondřej Surý [Wed, 18 Mar 2026 09:33:06 +0000 (10:33 +0100)] 
Fix update-policy per-type max quota bypass via counter desynchronization

The prescan and main update loops in DNS UPDATE processing both used the
same counter to index the maxbytype[] quota array.  The prescan loop
always incremented the counter, but the main loop had 14 continue paths
that skipped the increment.  This allowed an authenticated DDNS client to
craft an UPDATE message with padding records (e.g. CNAME+A pairs that
trigger CNAME-conflict skips) to shift the counter and read wrong quota
entries, bypassing per-type record limits entirely.

Fix by incrementing the counter unconditionally at the start of each
iteration in the main loop.

7 weeks agofix: usr: Fix the processing of empty catalog zone ACLs
Arаm Sаrgsyаn [Fri, 27 Mar 2026 12:37:33 +0000 (12:37 +0000)] 
fix: usr: Fix the processing of empty catalog zone ACLs

The :iscman:`named` process could terminate unexpectedly when
processing a catalog zone ACL in an APL resource record that
was completely empty. This has been fixed.

Closes #5801

Merge branch '5801-catz-empty-apl-rr-bug-fix' into 'main'

See merge request isc-projects/bind9!11740

7 weeks agoTest the ability to walk the iterators multiple times
Mark Andrews [Wed, 25 Mar 2026 05:15:42 +0000 (16:15 +1100)] 
Test the ability to walk the iterators multiple times

It should be possible to walk APL, HIP, HTTPS and SVBC record
elements multiple times.  We now test this.

7 weeks agoAllow the dns_rdata_in_apl structure to be walked twice
Mark Andrews [Wed, 25 Mar 2026 05:13:16 +0000 (16:13 +1100)] 
Allow the dns_rdata_in_apl structure to be walked twice

The offset value should be set prior to calculating the length.

7 weeks agoTest walking apl list entries
Mark Andrews [Wed, 25 Mar 2026 04:58:53 +0000 (15:58 +1100)] 
Test walking apl list entries

7 weeks agoTest an empty APL record as catalog zone ACL
Aram Sargsyan [Mon, 23 Mar 2026 15:17:47 +0000 (15:17 +0000)] 
Test an empty APL record as catalog zone ACL

Test that named can process an empty APL record as a valid catalog
zone ACL.

7 weeks agoAllow empty APL records
Aram Sargsyan [Mon, 23 Mar 2026 15:15:18 +0000 (15:15 +0000)] 
Allow empty APL records

Allow empty APL records because RFC 3123 (Section 4) says "zero or
more items". This fixes processing of a catalog zone ACL (which is
based on APL records) when the zone contains an empty APL record or
when a zone update arrives which creates an empty APL record.

7 weeks agochg: dev: Add low contention stats counter
Alessio Podda [Thu, 26 Mar 2026 10:53:29 +0000 (10:53 +0000)] 
chg: dev: Add low contention stats counter

In the current statistics counter implementation, the statistics are
backed by an array of counters, which are updated via atomic operations.
This leads to contention, especially on high core count
machines.

This commit introduces a new isc_statsmulti_t counter that keeps a
separate array per thread. These counters are then aggregated only when
statistics are queried, shifting work off the critical path.

These changes lead to a ~2% improvement in perflab.

Merge branch 'alessio/statsmulti-v2' into 'main'

See merge request isc-projects/bind9!11036

7 weeks agoMove ns_highwater_recursclients to highwater stats
Alessio Podda [Wed, 25 Mar 2026 12:12:41 +0000 (13:12 +0100)] 
Move ns_highwater_recursclients to highwater stats

Since it is impossible to increase an isc_statsmulti counter and
retrieve the new counter atomically, and we need the output of
recursclients in order to compute ns_highwater_recursive, we change the
recursclients counter to an isc_stats one.

7 weeks agoConvert isc_statsmulti to use ISC_REFCOUNT_IMPL
Alessio Podda [Wed, 25 Mar 2026 09:22:32 +0000 (10:22 +0100)] 
Convert isc_statsmulti to use ISC_REFCOUNT_IMPL

Instead of using hand-rolled attach and detach function, this commit
declares the same functions through the ISC_REFCOUNT_IMPL macro.

7 weeks agoAdd low contention stats counter
Alessio Podda [Fri, 5 Sep 2025 13:39:48 +0000 (15:39 +0200)] 
Add low contention stats counter

In the current statistics counter implementation, the statistics are
backed by an array of counters, which are updated via atomic operations.
This leads to contention, especially on high core count
machines.

This commit introduces a new isc_statsmulti_t counter that keeps a
separate array per thread. These counters are then aggregated only when
statistics are queried, shifting work off the critical path.

These changes lead to a ~2% improvement in perflab.

7 weeks agonew: usr: Add switch to disable cookie checking in delv
Mark Andrews [Thu, 26 Mar 2026 00:57:04 +0000 (11:57 +1100)] 
new: usr:  Add switch to disable cookie checking in delv

This adds the switch +[no]cookie to delv to control the sending of
DNS COOKIE options when sending requests.  The default is to send
DNS COOKIE options.

Closes #5825

Merge branch '5825-switch-to-disable-cookie-checking-in-delv' into 'main'

See merge request isc-projects/bind9!11733

7 weeks agoTest that delv +cookie and delv +nocookie work
Mark Andrews [Mon, 23 Mar 2026 07:06:16 +0000 (18:06 +1100)] 
Test that delv +cookie and delv +nocookie work

7 weeks agoDocument delv's +[no]cookie option
Mark Andrews [Mon, 23 Mar 2026 05:53:19 +0000 (16:53 +1100)] 
Document delv's +[no]cookie option

7 weeks agoAdd switch to disable cookie checking in delv
Mark Andrews [Mon, 23 Mar 2026 05:43:32 +0000 (16:43 +1100)] 
Add switch to disable cookie checking in delv

This adds the switch +[no]cookie to delv to control the sending of
DNS COOKIE options when sending requests.  The default is to send
DNS COOKIE options.

7 weeks agofix: ci: Fixes and tweaks for release-related jobs
Michał Kępień [Wed, 25 Mar 2026 17:13:18 +0000 (18:13 +0100)] 
fix: ci: Fixes and tweaks for release-related jobs

Merge branch 'michal/release-job-tweaks' into 'main'

See merge request isc-projects/bind9!11720

7 weeks agoFix distros token deletion in CI
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Fix distros token deletion in CI

Clone the BIND 9 QA repository before invoking a script in it.

7 weeks agoPrevent unscheduled release publication
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Prevent unscheduled release publication

The "publish" job has no dependencies on other jobs, so nothing prevents
it from being accidentally started before the scheduled publication
date.  Although publication still requires confirmation via an SSH
connection to a dedicated, locked-down runner, performing that action
prematurely may have drastic consequences.  Therefore, it is worth
implementing additional safeguards.

Add an extra check to the "publish" job to ensure it can only be run on
the scheduled publication day.  In exceptional circumstances, this check
can be overridden by setting the FORCE_PUBLICATION CI variable to any
non-empty value.

7 weeks agoTighten dependencies for tag-related jobs
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Tighten dependencies for tag-related jobs

The "merge-tag" and "update-stable-tag" jobs currently use the
"manual_release_job_qa" YAML anchor, which makes them depend on the
"staging" job.  Meanwhile, both of these jobs require the tag they were
created for to be public for them to work.  While this is harmless, as
these jobs will simply fail if they are run too early, it still makes
sense for them to depend on the "publish" job instead, if only to reduce
confusion in the pipeline view.  Adjust the "needs" key for the
"merge-tag" and "update-stable-tag" jobs accordingly.

7 weeks agoExtend artifact lifetime for Cloudsmith build jobs
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Extend artifact lifetime for Cloudsmith build jobs

The commit.txt file produced by each Cloudsmith build job is required to
run the corresponding publication job.  Therefore, the artifact lifetime
for the former must be long enough to prevent the file from expiring
before the publication job is run.  Set the lifetime of the artifacts
created by Cloudsmith build jobs to one month to ensure that the
publication jobs can access them.

7 weeks agoFix building EVN & -S Cloudsmith packages
Michał Kępień [Wed, 25 Mar 2026 17:09:02 +0000 (18:09 +0100)] 
Fix building EVN & -S Cloudsmith packages

Setting "artifacts: false" for the dependency on the "publish-private"
job prevents the url-*.txt files produced by that job from being pulled
from GitLab when the jobs that build EVN & -S Cloudsmith packages are
run, effectively breaking the latter.  Fix by making these jobs depend
on the artifacts of the "publish-private" job.

7 weeks agochg: test: Rename "nsec3-delegation" to "nsec3_delegation"
Michał Kępień [Wed, 25 Mar 2026 15:52:06 +0000 (16:52 +0100)] 
chg: test: Rename "nsec3-delegation" to "nsec3_delegation"

The "nsec3-delegation" test was added in a release branch, before commit
67aca1f8c6f19de11f238a402604697be4ff64dc introduced the current system
test naming convention.  Rename the test to comply with that convention.

Merge branch 'michal/rename-nsec3-delegation-test' into 'main'

See merge request isc-projects/bind9!11753

7 weeks agoRename "nsec3-delegation" to "nsec3_delegation"
Michał Kępień [Wed, 25 Mar 2026 14:36:17 +0000 (15:36 +0100)] 
Rename "nsec3-delegation" to "nsec3_delegation"

The "nsec3-delegation" test was added in a release branch, before commit
67aca1f8c6f19de11f238a402604697be4ff64dc introduced the current system
test naming convention.  Rename the test to comply with that convention.

7 weeks agoMerge tag 'v9.21.20' colin/bind-9.21.20
Michał Kępień [Wed, 25 Mar 2026 14:23:41 +0000 (14:23 +0000)] 
Merge tag 'v9.21.20'

7 weeks agonew: dev: optionally use libngtcp2 in development builds
Aydın Mercan [Wed, 25 Mar 2026 12:37:37 +0000 (15:37 +0300)] 
new: dev: optionally use libngtcp2 in development builds

Unlike new transports with a new dependency DNS-over-QUIC support will
be added incrementally due to the non-trivial amound of plumbing
required by libngtcp2. This will require non-functional QUIC code in the
main branch that won't be exposed for non-development builds.

Therefore, libngtcp2 is linked as an optional dependency only on
explicitly enabled development builds and cannot be required. This will
be changed with a `doq` meson build option once the server-side
functionality is complete for consumption.

Merge branch 'aydin/ngtcp2-dev-only' into 'main'

See merge request isc-projects/bind9!11557

7 weeks agooptionally use libngtcp2 only in development builds
Aydın Mercan [Tue, 17 Feb 2026 12:43:16 +0000 (15:43 +0300)] 
optionally use libngtcp2 only in development builds

Unlike new transports with a new dependency DNS-over-QUIC support will
be added incrementally due to the non-trivial amound of plumbing
required by libngtcp2. This will require non-functional QUIC code in the
main branch that won't be exposed for non-development builds.

Therefore, libngtcp2 is linked as an optional dependency only on
explicitly enabled development builds and cannot be required. This will
be changed with a `doq` meson build option once the server-side
functionality is complete for consumption.

7 weeks agofix: ci: Set User-Agent for Sphinx to fix gitlab.gnome.org
Michal Nowak [Wed, 25 Mar 2026 10:26:02 +0000 (11:26 +0100)] 
fix: ci: Set User-Agent for Sphinx to fix gitlab.gnome.org

The linkcheck started to fail because of a new check on gitlab.gnome.org
that now forbids Sphinx User-Agent, returnin 406 HTTP status.

    (       chapter10: line  115) broken    https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home - 406 Client Error: Not Acceptable for url: https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home

Merge branch 'mnowak/linkcheck-set-user-agent' into 'main'

See merge request isc-projects/bind9!11747

7 weeks agopkcs11-provider project has new home
Michal Nowak [Wed, 25 Mar 2026 09:47:42 +0000 (10:47 +0100)] 
pkcs11-provider project has new home

7 weeks agoSet User-Agent for Sphinx to fix gitlab.gnome.org
Michal Nowak [Wed, 25 Mar 2026 09:39:15 +0000 (10:39 +0100)] 
Set User-Agent for Sphinx to fix gitlab.gnome.org

The linkcheck started to fail because of a new check on gitlab.gnome.org
that now forbids Sphinx User-Agent, returnin 406 HTTP status.

    (       chapter10: line  115) broken    https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home - 406 Client Error: Not Acceptable for url: https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home

7 weeks agofix: dev: Remove legacy NS processing limit check
Colin Vidal [Wed, 25 Mar 2026 07:34:34 +0000 (08:34 +0100)] 
fix: dev: Remove legacy NS processing limit check

Commit `604d8f0b967563b0ba9dcd4f09559fdd9e21dfbe` introduced during 9.19
development cycle a check to ensure the resolver never attempts to
lookup more than 20 NS names. This limit was introduced by
`3a44097fd6c6c260765b628cd1d2c9cb7efb0b2a` as part of the CVE-2022-2795.

However, this test relies on the fact that, at the time, the NS names
were processed in a specific order in the nameserver.

This is not true anymore, as the NS are in a random order. Moreover,
commit `3c33e7d9370006b1599e3d99c0d5fa6a6dad7979` introduced the
randomization of the selection of the NS names to lookup, which make the
test potentially unreliable, as it now doesn't mean anything to check
the nameserver does not query `ns21.fake.redirect.com.`, as it could be
the first one, or in any position form the randomized list.

Another test has been added in commit
`c67b52684f11652b07afaa75a917f6f0355dbca6` which test both the
randomization of the NS name to be looked up, as well as the upper bound
limit of NS  name lookup to be done.

For all those reasons, this specific legacy check is now removed.

Merge branch 'colin/remove-incompatble-nslimit-check' into 'main'

See merge request isc-projects/bind9!11745

7 weeks agoremove legacy NS processing limit check
Colin Vidal [Tue, 24 Mar 2026 20:22:14 +0000 (21:22 +0100)] 
remove legacy NS processing limit check

Commit `604d8f0b967563b0ba9dcd4f09559fdd9e21dfbe` introduced during 9.19
development cycle a check to ensure the resolver never attempts to
lookup more than 20 NS names. This limit was introduced by
`3a44097fd6c6c260765b628cd1d2c9cb7efb0b2a` as part of the CVE-2022-2795.

However, this test relies on the fact that, at the time, the NS names
were processed in a specific order in the nameserver, as this snip from
the log (from a build on `604d8f0` branch) running the test illustrates:

```
24-Mar-2026 21:19:46.346 dispatch 0x7fdaa722d200: success, length == 19956, addr = 0x7fdaa0a7c102
24-Mar-2026 21:19:46.346 dispatch 0x7fdaa722d200: got valid DNS message header, /QR 1, id 14328
24-Mar-2026 21:19:46.346 dispatch 0x7fdaa722d200: search for response in bucket 7213: success
24-Mar-2026 21:19:46.354 received packet from 10.53.0.3#5300
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id:  14328
;; flags: qr aa; QUESTION: 1, ANSWER: 0, AUTHORITY: 999, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 1232
; COOKIE: baf16b0241efc700
;; QUESTION SECTION:
;large-referral.example.net. IN A

;; AUTHORITY SECTION:
;large-referral.example.net. 300 IN NS ns1.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns2.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns3.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns4.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns5.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns6.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns7.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns8.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns9.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns10.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns11.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns12.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns13.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns14.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns15.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns16.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns17.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns18.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns19.fake.redirect.com.
;large-referral.example.net. 300 IN NS ns20.fake.redirect.com.
```

This is not true anymore, as the NS are in a random order. Moreover,
commit `3c33e7d9370006b1599e3d99c0d5fa6a6dad7979` introduced the
randomization of the selection of the NS names to lookup, which make the
test potentially unreliable, as it now doesn't mean anything to check
the nameserver does not query `ns21.fake.redirect.com.`, as it could be
the first one, or in any position form the randomized list.

Another test has been added in commit
`c67b52684f11652b07afaa75a917f6f0355dbca6` which test both the
randomization of the NS name to be looked up, as well as the upper bound
limit of NS  name lookup to be done.

For all those reasons, this specific legacy check is now removed.

7 weeks agorem: usr: Remove -C option from dnssec-keygen and dnssec-keyfromlabel
Evan Hunt [Tue, 24 Mar 2026 20:24:58 +0000 (20:24 +0000)] 
rem: usr: Remove -C option from dnssec-keygen and dnssec-keyfromlabel

The -C option, introduced in BIND 9.7, caused a backward-compatible
key to be generated, using private key format version 1.2, omitting the
creation date and other timing metadata. This made it possible to
generate keys that could be loaded by older versions of BIND.

Those older versions having reached end of life many years ago, the
option can now be removed, along with the `dnssec-settime -f` option,
which caused old-style keys to be upgraded.

Merge branch 'each-remove-keygen-compat' into 'main'

See merge request isc-projects/bind9!11446

7 weeks agoremove -C option from dnssec-keygen and dnssec-keyfromlabel
Evan Hunt [Sat, 10 Jan 2026 07:37:49 +0000 (23:37 -0800)] 
remove -C option from dnssec-keygen and dnssec-keyfromlabel

The -C option, introduced in BIND 9.7, caused a backward-compatible
key to be generated, using private key format version 1.2, omitting the
creation date and other timing metadata. This made it possible to
generate keys that could be loaded by older versions of BIND.

Those older versions having reached end of life many years ago, the
option can now be removed, along with the "dnssec-settime -f" option,
which caused old-style keys to be upgraded.

7 weeks agofix: dev: rpz_rrset_find() now recurses on ISC_R_NOTFOUND
Evan Hunt [Tue, 24 Mar 2026 00:14:10 +0000 (00:14 +0000)] 
fix: dev: rpz_rrset_find() now recurses on ISC_R_NOTFOUND

Previously, `rpz_rrset_find()` behaved differently depending on whether
a cache lookup returned `DNS_R_DELEGATION` or `ISC_R_NOTFOUND`.  The former
indicates the presence of a cached NS rrset, and the latter indicates
that the cache is cold or that all NS rrsets above the query name have
expired. Both results indicate that the caller should recurse, but
`rpz_rrset_find()` only recursed in the case of `DNS_R_DELEGATION`. This
has been fixed and the test updated to match.

Merge branch 'each-rpz-recursion' into 'main'

See merge request isc-projects/bind9!11741

7 weeks agorpz_rrset_find() now recurses on ISC_R_NOTFOUND
Evan Hunt [Sun, 22 Mar 2026 03:28:24 +0000 (20:28 -0700)] 
rpz_rrset_find() now recurses on ISC_R_NOTFOUND

previously, rpz_rrset_find() behaved differently depending on whether
a cache lookup returned DNS_R_DELEGATION or ISC_R_NOTFOUND.  the former
indicates the presence of a cached NS rrset, and the latter indicates
that the cache is cold or that all NS rrsets above the query name have
expired. both results indicate that the caller should recurse, but
rpz_rrset_find() only recursed in the case of DNS_R_DELEGATION.

the nsip-wait-recurse and nsdname-wait-recurse test cases in the
rpzrecurse system test were dependent on this misbehavior. the test
server was configured with a lame delegation, so that recursion always
failed, but once the lame delegation was expired due to a zero TTL, the
cache returned ISC_R_NOTFOUND, which caused the recursion not to be
attempted. the test seemed to be observing a delay before recursion
succeeded, but it was actually observing a delay before recursion was
skipped. fixing this bug caused the test to fail.

the test server has now been reconfigured so that recursion succeeds
after a delay, instead of failing. now we're able to test that
we're waiting for the successful completion of recursion.

7 weeks agosec: usr: Fix crash when reconfiguring zone update policy during active updates
Ondřej Surý [Mon, 23 Mar 2026 11:10:49 +0000 (12:10 +0100)] 
sec: usr: Fix crash when reconfiguring zone update policy during active updates

Fixed a crash that could occur when running rndc reconfig to change a zone's update policy (e.g., from allow-update to update-policy) while DNS UPDATE requests were being processed for that zone.

ISC would like to thank Vitaly Simonovich for bringing this issue to our attention.

Fixes #5817

Merge branch '5817-fix-crash-via-SSU-table-desynchronization' into 'main'

See merge request isc-projects/bind9!11707

7 weeks agoAdd regression test for TOCTOU race in DNS UPDATE SSU handling
Ondřej Surý [Wed, 18 Mar 2026 03:09:50 +0000 (04:09 +0100)] 
Add regression test for TOCTOU race in DNS UPDATE SSU handling

Race rndc reconfig (toggling between allow-update and update-policy)
against a stream of DNS UPDATEs for 5 seconds and verify that named
does not crash.

Before the fix, the race between send_update() and update_action()
reading the SSU table independently could trigger an assertion
failure (INSIST) when the zone's update policy changed between the
two reads.

7 weeks agoFix TOCTOU race in DNS UPDATE SSU table handling
Ondřej Surý [Wed, 18 Mar 2026 02:55:51 +0000 (03:55 +0100)] 
Fix TOCTOU race in DNS UPDATE SSU table handling

Pass the SSU table through the update event struct from
send_update() to update_action() instead of reading it from the
zone twice.  If rndc reconfig changed the zone's update policy
between the two reads (e.g., from allow-update to update-policy),
send_update() would skip the maxbytype allocation but
update_action() would see a non-NULL ssutable, triggering
INSIST(ssutable == NULL || maxbytype != NULL) and crashing named.

The ssutable reference is now taken once in send_update() and
transferred to update_action() via the event struct, ensuring
both functions see the same value.

7 weeks agonew: dev: Add MOVE_OWNERSHIP() macro for transferring pointer ownership
Ondřej Surý [Mon, 23 Mar 2026 10:06:48 +0000 (11:06 +0100)] 
new: dev: Add MOVE_OWNERSHIP() macro for transferring pointer ownership

A helper macro that returns the current value of a pointer and sets
it to NULL in one expression, useful for transferring ownership in
designated initializers.

Merge branch 'ondrej/TAKE_OWNERSHIP-macro' into 'main'

See merge request isc-projects/bind9!11724