]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 months agorem: nil: Remove maybe_cancel_validators() function
Ondřej Surý [Sat, 8 Nov 2025 23:37:23 +0000 (00:37 +0100)] 
rem: nil: Remove maybe_cancel_validators() function

When shutting down an fctx, validators can just be canceled
without checking whether there are pending finds.

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

See merge request isc-projects/bind9!11229

6 months agoRemove maybe_cancel_validators() function
Evan Hunt [Sat, 25 Oct 2025 00:01:14 +0000 (17:01 -0700)] 
Remove maybe_cancel_validators() function

When shutting down an fctx, validators can just be canceled
without checking whether there are pending finds.

6 months agofix: test: Rewrite views/addzone in loop system test
Colin Vidal [Fri, 7 Nov 2025 14:46:15 +0000 (15:46 +0100)] 
fix: test: Rewrite views/addzone in loop system test

A part of the `views` system test attempts to add multiples zones in a
loop, and after each zone being added, reconfig the server.

However, the test didn't take into account the fact that the server
might take a bit more time to reload than the script to move to the next
iteration, and in some case the test was re-requesting the server reload
when it was still reloading.

Since `b49f83a3`, `named` explicitly fails to reload when a load/reload
is pending, which is (unless proved otherwise) the reason of the test
was now randomly failing.

That part of the test is now waiting for the server log message saying
the server has added the new zone and is running. Also, that part of the
test has been rewrote in Python.

Closes #5617

Merge branch '5617-rewrite-reload-view-test' into 'main'

See merge request isc-projects/bind9!11225

6 months agorewrite views/addzone in loop system test
Colin Vidal [Fri, 7 Nov 2025 09:45:09 +0000 (10:45 +0100)] 
rewrite views/addzone in loop system test

A part of the `views` system test attempts to add multiples zones in a
loop, and after each zone being added, reconfig the server.

However, the test didn't take into account the fact that the server
might take a bit more time to reload than the script to move to the next
iteration, and in some case the test was re-requesting the server reload
when it was still reloading.

Since `b49f83a3`, `named` explicitly fails to reload when a load/reload
is pending, which is (unless proved otherwise) the reason of the test
was now randomly failing.

That part of the test is now waiting for the server log message saying
the server has added the new zone and is running. Also, that part of the
test has been rewrote in Python.

6 months agoUpdate BIND version for release v9.21.15
Michal Nowak [Fri, 7 Nov 2025 09:34:27 +0000 (10:34 +0100)] 
Update BIND version for release

6 months agonew: doc: Prepare documentation for BIND 9.21.15
Michal Nowak [Fri, 7 Nov 2025 09:20:54 +0000 (10:20 +0100)] 
new: doc: Prepare documentation for BIND 9.21.15

Merge branch 'mnowak/prepare-documentation-for-bind-9.21.15' into 'v9.21.15-release'

See merge request isc-private/bind9!877

6 months agoDrop #5525 and fuzzing-related release notes
Michal Nowak [Thu, 6 Nov 2025 16:51:04 +0000 (17:51 +0100)] 
Drop #5525 and fuzzing-related release notes

6 months agoReorder release notes
Michal Nowak [Thu, 6 Nov 2025 16:49:38 +0000 (17:49 +0100)] 
Reorder release notes

6 months agoTweak and reword release notes
Michal Nowak [Thu, 6 Nov 2025 11:23:11 +0000 (12:23 +0100)] 
Tweak and reword release notes

6 months agofix: test: Harden EDE 24 system tests
Colin Vidal [Thu, 6 Nov 2025 15:13:29 +0000 (16:13 +0100)] 
fix: test: Harden EDE 24 system tests

Harden `ede24` system test in order to avoid random failures, likely caused by timing issues. Also remove expiration-related dead-code (which should have been done in the original ede24 changes) as well as printing the query ID, as this should be useful to debug further flaky system test issues. (In particular, this one, if the changes made here are not enough).

Closes #5625

Merge branch '5625-fix-ede24-test' into 'main'

See merge request isc-projects/bind9!11217

6 months agosplit ede24 system test into separate modules
Colin Vidal [Thu, 6 Nov 2025 13:35:33 +0000 (14:35 +0100)] 
split ede24 system test into separate modules

Because ede24 system tests require stopping/restarting server, there is
always the risk that the test ends (with a failure) with server in an
wrong and impredictible state. This would make the other tests to fail
in a strange way as well.

To avoid this problem, split the test into different modules, so if a
module fails, the other module is not impacted as it uses separate
server instances.

6 months agoharden ede24 system test
Colin Vidal [Wed, 5 Nov 2025 14:08:51 +0000 (15:08 +0100)] 
harden ede24 system test

There was a random failure of ede24 system test. While this is still a
bit speculative, the two reasons were:

- in the case of `test_ede24_noloaded` the test might attempt to early
  (before the zone actually transfered on the secondary server) to query
  ns2.

- still in the case of `test_ede24_noloaded`, even after waiting for
  transfer succeed logs, if the CI machine is slow, the zone could be
  expired before the request checking the secondary zone works because
  the expiration time of the zone was very short (1s). Moving this
  expiration time to 3 seconds should be enough (while not making the
  test execution too much longer when waiting for the zone expiration).

- in the case of `test_ede24_expired`, the zone expired flag is flipped
  and the log message is printed immediately after. However, it is
  possible that because the flag is set using a relaxed atomic
  operation, another thread process the query and gets the previous
  (non-expired) value of the flag. In order to workaround this, the
  test now also expects another log written after the zone expiration
  (stop timers) on the next UV tick.

6 months agoadd query ID to the query trace message
Colin Vidal [Wed, 5 Nov 2025 14:06:03 +0000 (15:06 +0100)] 
add query ID to the query trace message

Adding the query ID to the query trace message. The log is now as the
following (id is at the end):

    query client=0x7f75c5017000 thread=0x7f75c6dfe680(foo.fr/A): \
      client attr:0x22300, query attr:0x700, restarts:0, \
      origqname:foo.fr, timer:0, authdb:0, referral:0, id:21338

This should help debugging tests, in particular to quickly get a
specific query from the logs.

6 months agoremove dns_zone_expire dead code
Colin Vidal [Wed, 5 Nov 2025 13:57:33 +0000 (14:57 +0100)] 
remove dns_zone_expire dead code

Removing `dns_zone_expire` function which is never called (the zone
expiration is detected internally in `lib/dns/zone.c`).

6 months agochg: dev: Refactor zone fetch code
Matthijs Mekking [Thu, 6 Nov 2025 12:01:55 +0000 (12:01 +0000)] 
chg: dev: Refactor zone fetch code

There is code duplication between `keyfetch` and `nsfetch`, refactor to allow common code paths to differentiate between them. This is in preparation for support of generalized DNS notifications, that will require fetching DSYNC records.

Merge branch 'matthijs-refactor-zone-fetch' into 'main'

See merge request isc-projects/bind9!11176

6 months agoSchedule a zonefetch
Matthijs Mekking [Thu, 6 Nov 2025 09:41:50 +0000 (10:41 +0100)] 
Schedule a zonefetch

Scheduling and rescheduling a zonefetch is also similar.  Refactor into
zonefetch functions.  This also increments and decrements the zone's
internal reference counter in the same module, which may be less
confusing when reading the code.

6 months agoPrepare release notes for BIND 9.21.15
Michal Nowak [Thu, 6 Nov 2025 10:48:00 +0000 (11:48 +0100)] 
Prepare release notes for BIND 9.21.15

6 months agoGenerate changelog for BIND 9.21.15
Michal Nowak [Thu, 6 Nov 2025 10:45:48 +0000 (11:45 +0100)] 
Generate changelog for BIND 9.21.15

6 months agoFix comment in lib/ns/query.c
Matthijs Mekking [Tue, 4 Nov 2025 16:17:13 +0000 (17:17 +0100)] 
Fix comment in lib/ns/query.c

While renaming exit_check() to dns__zone_free_check() in lib/dns/zone.c,
a dead reference to exit_check() in the comments was found in
lib/ns/query.c.

6 months agoA unified way to verify the zone fetch
Matthijs Mekking [Fri, 31 Oct 2025 08:04:13 +0000 (09:04 +0100)] 
A unified way to verify the zone fetch

There is a lot of similarity when checking the completed fetch is legit.
Create a new function to verify the fetch and to reduce code
duplication.

6 months agoCount per fetch type
Matthijs Mekking [Thu, 30 Oct 2025 10:01:04 +0000 (11:01 +0100)] 
Count per fetch type

Track fetch counts per type in an array, rather than special named
variables within the zone structure.

6 months agoRefactor zone fetch code
Matthijs Mekking [Wed, 29 Oct 2025 13:02:45 +0000 (14:02 +0100)] 
Refactor zone fetch code

There is code duplication between keyfetch and nsfetch, refactor to
allow common code paths to differentiate between them.

6 months agoExport zone functions
Matthijs Mekking [Wed, 29 Oct 2025 14:30:46 +0000 (15:30 +0100)] 
Export zone functions

Make some zone functions available that we are going to need in the
zonefetch code.

6 months agochg: ci: Run system tests on all platforms on MR that touches system tests
Štěpán Balážik [Thu, 6 Nov 2025 09:08:30 +0000 (09:08 +0000)] 
chg: ci: Run system tests on all platforms on MR that touches system tests

Not doing this has lead to breakage caused by different dnspython
versions on different platforms only discovered in full nightly
pipelines.

Add a triggering rule for MRs changing code in bin/test/system.
Apply this rule to all nightly-only system test jobs.

Merge branch 'stepan/run-all-system-tests-on-system-test-change' into 'main'

See merge request isc-projects/bind9!11214

6 months agoRun system tests on all platforms on MR that touches system tests
Štěpán Balážik [Wed, 5 Nov 2025 10:19:04 +0000 (11:19 +0100)] 
Run system tests on all platforms on MR that touches system tests

Not doing this has lead to breakage caused by different dnspython
versions on different platforms only discovered in full nightly
pipelines.

Add a triggering rule for MRs changing code in bin/test/system.
Apply this rule to all nightly-only system test jobs.

6 months agochg: doc: Set up version for BIND 9.21.16
Michal Nowak [Wed, 5 Nov 2025 18:38:15 +0000 (19:38 +0100)] 
chg: doc: Set up version for BIND 9.21.16

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

See merge request isc-projects/bind9!11218

6 months agoUpdate BIND version to 9.21.16-dev
Michal Nowak [Wed, 5 Nov 2025 18:32:17 +0000 (19:32 +0100)] 
Update BIND version to 9.21.16-dev

6 months agofix: dev: Fix parser test (missing string termination)
Colin Vidal [Wed, 5 Nov 2025 12:59:23 +0000 (13:59 +0100)] 
fix: dev: Fix parser test (missing string termination)

Compare only the dumped configuration as the `cfg_printx` does not NULL-terminate the configuration strings.

Merge branch 'colin/fix-parser-test' into 'main'

See merge request isc-projects/bind9!11215

6 months agoFix parser test (missing string termination)
Ondřej Surý [Wed, 5 Nov 2025 11:39:43 +0000 (12:39 +0100)] 
Fix parser test (missing string termination)

Parser test could crash because the `dumpb2` buffer hasn't explicit C
NULL string termination after dumping the configuration tree in it.
`cfg_printx` does not doing this by default.

Fix the test by comparing only the strings written with strncmp.

6 months agofix: test: Fix NSEC3HASH system test on jammy
Štěpán Balážik [Wed, 5 Nov 2025 11:54:23 +0000 (11:54 +0000)] 
fix: test: Fix NSEC3HASH system test on jammy

a94aab94404201a662c1e1d3e53cdeae0f5c8db5 removed importorskip call from
isctest.name on which the functionality of this test relied.

Add an explicit importorskip call to the test.

Merge branch 'stepan/fix-tools-nsec3hash-on-jammy' into 'main'

See merge request isc-projects/bind9!11213

6 months agoFix NSEC3HASH system test on jammy
Štěpán Balážik [Wed, 5 Nov 2025 09:51:26 +0000 (10:51 +0100)] 
Fix NSEC3HASH system test on jammy

a94aab94404201a662c1e1d3e53cdeae0f5c8db5 removed importorskip call from
isctest.name on which the functionality of this test relied.

Add an explicit importorskip call to the test.

6 months agofix: usr: Skip unsupported algorithms when looking for signing key
Ondřej Surý [Tue, 4 Nov 2025 19:30:08 +0000 (20:30 +0100)] 
fix: usr: Skip unsupported algorithms when looking for signing key

A mix of supported and unsupported DNSSEC algorithms in the same zone could have caused validation failures. Ignore the DNSSEC keys with unsupported algorithm when looking for the signing keys.

Closes #5622

Merge branch '5622-dont-fail-on-unsupported-algorithms' into 'main'

See merge request isc-projects/bind9!11208

6 months agoSkip unsupported algorithms when looking for signing key
Ondřej Surý [Tue, 4 Nov 2025 01:09:38 +0000 (02:09 +0100)] 
Skip unsupported algorithms when looking for signing key

When looking for a signing key in select_signing_key(), the result code
indicating unsupported algorithm would abort the search.  Instead, skip
such keys and continue searching for the right key.

Co-Authored-By: Aram Sargsyan <aram@isc.org>
Co-Authored-By: Petr Menšík <pemensik@redhat.com>
6 months agoAdd a system test with one good and one bad algorithm
Ondřej Surý [Sat, 1 Nov 2025 11:00:59 +0000 (12:00 +0100)] 
Add a system test with one good and one bad algorithm

The case where there would be one supported algorithm and one already
unsupported (like RSAMD5 or RSASHA1) was missing.

6 months agofix: dev: Only unlink from SIEVE LRU if it is still linked
Ondřej Surý [Tue, 4 Nov 2025 18:53:09 +0000 (19:53 +0100)] 
fix: dev: Only unlink from SIEVE LRU if it is still linked

Under the overmem conditions, the header could get unlinked from the
SIEVE LRU using a different path.  This could lead to double-unlink
which causes assertion failure.  Add a guard to ISC_SIEVE_UNLINK() to
unlink only still linked headers.

Closes #5606

Merge branch '5606-fix-assertion-failure-in-overmem-cleaning' into 'main'

See merge request isc-projects/bind9!11166

6 months agoOnly unlink from SIEVE LRU if it is still linked
Ondřej Surý [Wed, 29 Oct 2025 06:18:55 +0000 (07:18 +0100)] 
Only unlink from SIEVE LRU if it is still linked

Under the overmem conditions, the header could get unlinked from the
SIEVE LRU using a different path.  This could lead to double-unlink
which causes assertion failure.  Add a guard to ISC_SIEVE_UNLINK() to
unlink only still linked headers.

6 months agofix: test: Require dnspython>2.0.0 in system tests using asyncserver
Štěpán Balážik [Tue, 4 Nov 2025 17:14:35 +0000 (17:14 +0000)] 
fix: test: Require dnspython>2.0.0 in system tests using asyncserver

Maintaining compatibility with pre-2.0.0 dnspython became cumbersome
leading to failure in nightly CI jobs which are the only ones that run
with dnspython this old.

Abort all AsyncServer instances when running with old dnspython. Add an
importor skip for all system tests using isctest.asyncserver.

Full removal of pre-2.0.0 `dnspython` support is planned for after 9.18
goes EoL.

Merge branch 'stepan/require-dnspython-2-for-asyncserver' into 'main'

See merge request isc-projects/bind9!11191

6 months agoRun system tests on AlmaLinux 8 on merge requests in CI
Štěpán Balážik [Fri, 31 Oct 2025 12:10:46 +0000 (13:10 +0100)] 
Run system tests on AlmaLinux 8 on merge requests in CI

Ensure that system tests don't blow up completely with pre-2.0.0
dnspython.

6 months agoRequire dnspython>2.0.0 in system tests using asyncserver
Štěpán Balážik [Fri, 31 Oct 2025 11:04:39 +0000 (12:04 +0100)] 
Require dnspython>2.0.0 in system tests using asyncserver

Maintaining compatibility with pre-2.0.0 dnspython became cumbersome
leading to failure in nightly CI jobs which are the only ones that run
with dnspython this old.

Abort all AsyncServer instances when running with old dnspython. Add an
importor skip for all system tests using isctest.asyncserver.

6 months agoDon't use pytest.importorskip in isctest.name
Štěpán Balážik [Tue, 4 Nov 2025 12:40:26 +0000 (13:40 +0100)] 
Don't use pytest.importorskip in isctest.name

They can be used outside of test modules (like ans.py custom servers)
which leads to pytest.outcomes.Skipped being raised in weird places and
skipping of tests which don't need dnspython this new.

Remove pytest.importskip from top scope in isctest.name, only run the
check when ZoneAnalyzer is used.

6 months agonew: ci: Add vulnerability-related jobs
Michał Kępień [Tue, 4 Nov 2025 11:53:46 +0000 (12:53 +0100)] 
new: ci: Add vulnerability-related jobs

Merge branch 'michal/add-vulnerability-related-jobs-to-ci' into 'main'

See merge request isc-projects/bind9!11188

6 months agoAdd a job preparing post-disclosure notifications
Michał Kępień [Tue, 4 Nov 2025 11:51:35 +0000 (12:51 +0100)] 
Add a job preparing post-disclosure notifications

Add a new GitLab CI job that automatically generates post-disclosure
notifications for BIND 9 security releases based on the metadata for the
current release cycle.

6 months agoAdd a job preparing packager notifications
Michał Kępień [Tue, 4 Nov 2025 11:51:35 +0000 (12:51 +0100)] 
Add a job preparing packager notifications

Add a new GitLab CI job that automatically generates T-1 packager
notifications for BIND 9 security releases based on the metadata for the
current release cycle.

6 months agoAdd a job preparing security pre-announcements
Michał Kępień [Tue, 4 Nov 2025 11:51:35 +0000 (12:51 +0100)] 
Add a job preparing security pre-announcements

Add a new GitLab CI job that automatically generates public T-5
pre-announcements for BIND 9 security releases based on the metadata for
the current release cycle.

6 months agoAdd a job preparing EVNs
Michał Kępień [Tue, 4 Nov 2025 11:51:35 +0000 (12:51 +0100)] 
Add a job preparing EVNs

Add a new GitLab CI job that automatically generates BIND 9 Early
Vulnerability Notifications based on the metadata for the current
release cycle.

6 months agoEnable overriding the list of security releases
Michał Kępień [Tue, 4 Nov 2025 11:51:35 +0000 (12:51 +0100)] 
Enable overriding the list of security releases

Enable manually providing (via an optional CI variable) Printing Press
jobs with the list of security releases in a given release cycle in case
autodetection fails for any reason.

6 months agoEnable overriding the list of fixed CVE IDs
Michał Kępień [Tue, 4 Nov 2025 11:51:35 +0000 (12:51 +0100)] 
Enable overriding the list of fixed CVE IDs

Enable manually providing (via an optional CI variable) Printing Press
jobs with the list of CVE IDs fixed in a given release cycle in case
autodetection fails for any reason.

6 months agoDeduplicate definitions of release-related jobs
Michał Kępień [Tue, 4 Nov 2025 11:51:35 +0000 (12:51 +0100)] 
Deduplicate definitions of release-related jobs

Extract common YAML keys used by release-related job definitions into
reusable anchors to ensure consistency and limit repetition across
multiple similar jobs.

6 months agoChange the script generating release announcements
Michał Kępień [Tue, 4 Nov 2025 11:51:35 +0000 (12:51 +0100)] 
Change the script generating release announcements

Use a different, generic script for preparing release announcements.

6 months agonew: usr: "named-checkconf -b" dumps the built-in configuration
Colin Vidal [Tue, 4 Nov 2025 09:04:31 +0000 (10:04 +0100)] 
new: usr: "named-checkconf -b" dumps the built-in configuration

`named-checkconf` now supports the command line switch `-b`,  which prints the default built-in configuration used by `named`.

When `-b` is in use, other options are ignored.

Closes #1326

Merge branch '1326-named-checkconf-builtin' into 'main'

See merge request isc-projects/bind9!11177

6 months ago"named-checkconf -b" dumps built-in config
Colin Vidal [Thu, 30 Oct 2025 09:00:59 +0000 (10:00 +0100)] 
"named-checkconf -b" dumps built-in config

`named-checkconf` now supports the command line switch `-b`,  which
prints the default built-in configuration used by `named`.

When `-b` is in use, other options are ignored.

6 months agofix: usr: Prevent assertion failures of dig when server is specified before the ...
Arаm Sаrgsyаn [Tue, 4 Nov 2025 08:00:25 +0000 (08:00 +0000)] 
fix: usr: Prevent assertion failures of dig when server is specified before the -b option

Previously, :iscman:`dig` could exit with an assertion failure when the server was specified before the :option:`dig -b` option. This has been fixed.

Closes #5609

Merge branch '5609-fix-dig-crash-with-at-and-dash-b-on-main' into 'main'

See merge request isc-projects/bind9!11183

6 months agoTest dig with a IPv4 source address and a IPv4+IPv6 server
Aram Sargsyan [Fri, 31 Oct 2025 16:34:47 +0000 (16:34 +0000)] 
Test dig with a IPv4 source address and a IPv4+IPv6 server

Check that dig doesn't exit with an assertion failure when a IPv4
source address is defined after defining a server address which has
both IPv4 and IPv6 addresses (in this case, @localhost).

6 months agoavoid retrying a server if its address is unusable
JINMEI Tatuya [Thu, 30 Oct 2025 04:58:18 +0000 (21:58 -0700)] 
avoid retrying a server if its address is unusable

Previously, if there's no more server to try in force_next,
it attempted to retry the current server similar to a query
timeout case. But, force_next() is called only when the
current server's address is unusable and the query was not
even sent, so recvcount was not incremented, causing an
assertion failure.

We might be able to fix it so the retry doesn't cause a crash,
but it doesn't make sense to retry the server when its address
is known to be unusable. So, simply avoiding the retry would be
the easiest and safest way to prevent the crash.

6 months agomake sure current_query is detached before trying next server
JINMEI Tatuya [Thu, 30 Oct 2025 00:51:59 +0000 (17:51 -0700)] 
make sure current_query is detached before trying next server

Without this, start_udp or start_tcp would trigger an assertion
failure. Detaching it at this point is also consistent with
other failure handling cases, such as in recv_done.

6 months agonew: usr: Add support for Extended DNS Error 24 (Invalid Data)
Colin Vidal [Mon, 3 Nov 2025 17:25:38 +0000 (18:25 +0100)] 
new: usr: Add support for Extended DNS Error 24 (Invalid Data)

Extended DNS Error 24 (Invalid Data) is returned when the server cannot answer data for a zone it is configured for. This occurs typically when an authoritative server does not have loaded the DB of a configured zone, or a secondary server zone is expired.

See RFC 8914 section 4.25.

See #1836

Merge branch 'colin/ede24' into 'main'

See merge request isc-projects/bind9!11169

6 months agolog that a zone is expired after setting the flag
Colin Vidal [Mon, 3 Nov 2025 16:31:26 +0000 (17:31 +0100)] 
log that a zone is expired after setting the flag

When a (secondary) zone is expired, the log message `<zone> expired` is
printed and the flag `DNS_ZONEFLG_EXPIRED` is set. Change the order by
setting the expired flag first, then printing the log.

This should fixes (rare but persistent) timing-related CI error when the
EDE 24 tests expect the zone to be expired (from the log) and
immediately after request and expect an EDE 24 error. (In some rare
cases, the server was still answering the response).

6 months agoadd tests for EDE 24 support
Colin Vidal [Wed, 29 Oct 2025 16:32:29 +0000 (17:32 +0100)] 
add tests for EDE 24 support

Add system test covering EDE 24 being added in the response in both
common cases: when the server has not loaded the DB of a zone and when
the zone has expired (secondary).

6 months agosupport EDE 24 (Invalid Data)
Colin Vidal [Fri, 31 Oct 2025 11:16:54 +0000 (12:16 +0100)] 
support EDE 24 (Invalid Data)

Extended DNS Error 24 (Invalid Data) is returned when the server cannot
answer data for a zone it is configured for. This occurs typically when
an authoritative server does not have loaded the DB of a configured
zone, or a secondary server zone is expired.

See RFC 8914 section 4.25.

6 months agoquery_getzonedb can returns DNS_R_EXPIRED
Colin Vidal [Fri, 31 Oct 2025 11:15:00 +0000 (12:15 +0100)] 
query_getzonedb can returns DNS_R_EXPIRED

If `query_getzonedb()` finds a zone but the zone is expired it
immediately returns `DNS_R_EXPIRED` and doesn't attempt to get the zone
DB (which would be NULL in this case).

This enable caller to have a more precise reason of why getting the DB
has failed.

6 months agoadd dns_zone_isexpired API
Colin Vidal [Fri, 31 Oct 2025 11:12:20 +0000 (12:12 +0100)] 
add dns_zone_isexpired API

Introduce the `dns_zone_isexpired()` API which returns `true` when a
secondary, mirror, etc. zone is expired.

This internally use the `DNS_ZONEFLG_EXPIRED` which was already set when
the zone gets expired, but never used.

The flag `DNS_ZONEFLG_EXPIRED` is also now cleared when the expiration
time of the zone is updated and in the future.

6 months agorem: nil: Remove leftover FCTX_ATTR_NEEDEDNS0
Petr Špaček [Mon, 3 Nov 2025 15:25:20 +0000 (15:25 +0000)] 
rem: nil: Remove leftover FCTX_ATTR_NEEDEDNS0

Merge branch 'pspacek/remove-dead-NEEDEDNS0' into 'main'

See merge request isc-projects/bind9!11198

6 months agoRemove leftover FCTX_ATTR_NEEDEDNS0
Petr Špaček [Sat, 1 Nov 2025 22:35:35 +0000 (18:35 -0400)] 
Remove leftover FCTX_ATTR_NEEDEDNS0

This is leftover from commit b6309ed962c4988a314d61742c4fbc4935467d68
which removed support for bitstring labels back in 2002.

6 months agofix: dev: Remove unused dns_zone_getnotifyacl() function
Matthijs Mekking [Mon, 3 Nov 2025 14:38:12 +0000 (14:38 +0000)] 
fix: dev: Remove unused dns_zone_getnotifyacl() function

Deals with Coverity issues:
- CID 638286: Concurrent data access violations (MISSING_LOCK).
- CID 638287: Concurrent data access violations (MISSING_LOCK).

Merge branch 'matthijs-cid-638286-missing-lock' into 'main'

See merge request isc-projects/bind9!11200

6 months agoRemove unused dns_zone_getnotifyacl() function
Matthijs Mekking [Mon, 3 Nov 2025 11:45:39 +0000 (12:45 +0100)] 
Remove unused dns_zone_getnotifyacl() function

CID 638286: Concurrent data access violations (MISSING_LOCK).  This
complains about accessing "zone->notifyctx.notify_acl" without holding
the lock "dns_zone.lock".  Elsewhere, reading this data does have the
lock, so it makes sense that in the getter function this must also be
so.  However, the function is unused so we can just remove it.

CID 638287: Concurrent data access violations (MISSING_LOCK).  This
complains about accessing "zone->locked" without holding the lock
"dns_zone.lock". I think this is a false positive as "dns__zone_lock()"
and "dns__zone_unlock() are wrappers around "LOCK_ZONE()" and
"UNLOCK_ZONE()" and where these macros were used they were only
replaced with the internal zone functions. Moreover, "zone->locked"
is only accessed in these macros (and "TRYLOCK_ZONE()" and
"LOCKED_ZONE()").

6 months agofix: dev: restore reuseport to yes by default on supported platforms
Colin Vidal [Fri, 31 Oct 2025 14:50:56 +0000 (15:50 +0100)] 
fix: dev: restore reuseport to yes by default on supported platforms

Changes introduced by 72862c2a moved the
default configuration from within `bin/named` to a central place
`bin/includes`.

The default configuration is conditioned by several compile-time macro.
While for most of them it's fine because they are defined in the global
`config.h` file included by default to all binaries (by meson), one
specific is not defined here. `HAVE_SO_REUSEPORT_LB` was defined in
`lib/isc/include/isc/netmgr.h` which is of course not included in
`bin/includes/defaultconfig.h`.

As a result, reuseport was disabled for all platform by default, even
the supported ones. This fixes the problem by checking if reuseport is
available on the platform from meson `config.h` generation directly,
which makes `HAVE_SO_REUSEPORT_LB` available everywhere.

Merge branch 'colin/fix-reuseport-default' into 'main'

See merge request isc-projects/bind9!11180

6 months agorestore reuseport to yes by default on supported platforms
Colin Vidal [Thu, 30 Oct 2025 14:02:10 +0000 (15:02 +0100)] 
restore reuseport to yes by default on supported platforms

Changes introduced by 72862c2abc0bc6e87de08918bf21a7fc8fc4b1f7 moved the
default configuration from within `bin/named` to a central place
`bin/includes`.

The default configuration is conditioned by several compile-time macro.
While for most of them it's fine because they are defined in the global
`config.h` file included by default to all binaries (by meson), one
specific is not defined here. `HAVE_SO_REUSEPORT_LB` was defined in
`lib/isc/include/isc/netmgr.h` which is of course not included in
`bin/includes/defaultconfig.h`.

As a result, reuseport was disabled for all platform by default, even
the supported ones. This fixes the problem by checking if reuseport is
available on the platform from meson `config.h` generation directly,
which makes `HAVE_SO_REUSEPORT_LB` available everywhere.

6 months agochg: dev: Refactor notify code
Matthijs Mekking [Fri, 31 Oct 2025 13:47:19 +0000 (13:47 +0000)] 
chg: dev: Refactor notify code

Move notify code in separate source files in preparation for support of generalized DNS notifications.

Merge branch 'matthijs-refactor-notify-code-2' into 'main'

See merge request isc-projects/bind9!11146

6 months agoMove notify functions to notify source files
Matthijs Mekking [Fri, 24 Oct 2025 12:21:25 +0000 (14:21 +0200)] 
Move notify functions to notify source files

Move dns_notify_destroy, dns_notify_log, dns_notify_cancel,
dns_notify_queue, dns_notify_isqueued, dns_notify_find_address, and
notify related static functions over to the notify source files.

6 months agoExport zone functions
Matthijs Mekking [Fri, 17 Oct 2025 14:14:09 +0000 (16:14 +0200)] 
Export zone functions

Make some zone functions available that we are going to need in the
notify code.

6 months agoIntroduce notify source code files
Matthijs Mekking [Thu, 16 Oct 2025 15:01:57 +0000 (17:01 +0200)] 
Introduce notify source code files

Part of refactoring zone.c is to move the notify code into its own
source files. This commit initiates this work by creating notify.[c,h]
and move notify_create() and the notify state and context there.

The function notify_create() cannot fail, so it can return void instead
of isc_result_t.

6 months agoRename notify remote to alsonotify
Matthijs Mekking [Fri, 17 Oct 2025 13:55:00 +0000 (15:55 +0200)] 
Rename notify remote to alsonotify

Make it more clear it is tied to the 'also-notify' option.

6 months agofix: usr: Skip buffer allocations if not logging
Alessio Podda [Fri, 31 Oct 2025 12:16:03 +0000 (12:16 +0000)] 
fix: usr: Skip buffer allocations if not logging

Currently, during IXFR we allocate a 2KB buffer for IXFR change logging
regardless of the log level. This commit introduces an early check
on the log level in dns_diff_print to avoid this.

Results in a speedup from 28% in the test case from issue #5442.

Merge branch '5442-ixfr-no-log-alloc' into 'main'

See merge request isc-projects/bind9!11178

6 months agoSkip buffer allocations if not logging
Alessio Podda [Thu, 30 Oct 2025 10:45:09 +0000 (11:45 +0100)] 
Skip buffer allocations if not logging

Currently, during IXFR we allocate a 2KB buffer for IXFR change logging
regardless of the log level. This commit introduces an early check
on the log level in dns_diff_print to avoid this.

Results in a speedup from 28% in the test case from issue #5442.

6 months agochg: dev: Don't retain the default configuration tree
Colin Vidal [Fri, 31 Oct 2025 08:25:36 +0000 (09:25 +0100)] 
chg: dev: Don't retain the default configuration tree

The built-in configuration is actually used in two cases: first, when the server is loaded (or reloaded), and second when `rndc showconf -builtin` is called.

Considering the parsing of the builtin configuration is quick and does not occur during exclusive mode, but the configuration tree takes considerable memory space, the built-in configuration is no longer kept in memory once it has been used; instead it is re-parsed on demand.

Merge branch 'colin/not-persist-builtin-config' into 'main'

See merge request isc-projects/bind9!11187

6 months agodon't retain the default configuration
Colin Vidal [Thu, 30 Oct 2025 22:18:54 +0000 (23:18 +0100)] 
don't retain the default configuration

The built-in configuration is actually used in two cases: first, when
the server is loaded (or reloaded), and second when
'rndc showconf -builtin' is called.

Considering the parsing of the builtin configuration is quick and does
not occur during exclusive mode, but the configuration tree takes
considerable memory space, the built-in configuration is no longer kept
in memory once it has been used; instead it is re-parsed on demand.

6 months agofix: dev: Save userconfig as text instead of a cfg_obj tree
Evan Hunt [Thu, 30 Oct 2025 23:31:50 +0000 (23:31 +0000)] 
fix: dev: Save userconfig as text instead of a cfg_obj tree

Once the user configuration has been merged into the effective configuration, it no longer needs to be accessed as a configuration tree, but we still want to be able to show it with `rndc showconf -user`.

Because the recursive strucure of `cfg_obj` objects is fairly large, the canonical text form is a fraction of the size of the configuration tree, so we now save it in that form instead.

Merge branch 'each-userconfig-text' into 'main'

See merge request isc-projects/bind9!11185

6 months agosave userconfig as text instead of a cfg_obj tree
Evan Hunt [Thu, 30 Oct 2025 20:01:44 +0000 (13:01 -0700)] 
save userconfig as text instead of a cfg_obj tree

once the user configuration has been merged into the effective
configuration, it no longer needs to be accessed as a configuration
tree, but we still want to be able to show it with 'rndc showconf -user'.

because the recursive strucure of cfg_obj objects is fairly large, the
canonical text form is a fraction of the size of the configuration
tree, so we now save it in that form instead.

6 months agofix: dev: Reduce the size of cfg_obj_t
Evan Hunt [Thu, 30 Oct 2025 22:54:49 +0000 (22:54 +0000)] 
fix: dev: Reduce the size of cfg_obj_t

Instead of having `isc_sockaddr`, `isc_netaddr`, and `isccfg_duration` members in the `cfg_obj->value`
union, we now just keep pointers to them, and allocate memory when parsing these types. This reduces the
size of `cfg_obj_t` from 112 bytes to 72.

Merge branch 'each-refactor-cfg-obj' into 'main'

See merge request isc-projects/bind9!11186

6 months agofurther shrink cfg_obj_t by using a pointer for duration
Evan Hunt [Thu, 30 Oct 2025 21:07:44 +0000 (14:07 -0700)] 
further shrink cfg_obj_t by using a pointer for duration

not storing the isccfg_duration object inside cfg_obj reduces
its size from 80 to 72 bytes.

6 months agoreduce the size of cfg_obj by using pointers for addresses
Evan Hunt [Thu, 30 Oct 2025 20:40:10 +0000 (13:40 -0700)] 
reduce the size of cfg_obj by using pointers for addresses

instead of having sockaddr and netaddr members in the cfg_obj->value
union, we now just keep pointers, and allocate memory when parsing
these types. this reduces the size of cfg_obj_t from 112 to 80 bytes.

6 months agofix: dev: Remove sun_path field from isc_netaddr
Evan Hunt [Thu, 30 Oct 2025 19:46:50 +0000 (19:46 +0000)] 
fix: dev: Remove sun_path field from isc_netaddr

The `sun_path` field is not used anymore, and consumes over a hundred bytes for every `isc_netaddr_t` object. Remove it.

As `isc_netaddr_t` is used in `cfg_obj_t`, in some huge configuration trees (e.g., a million zones), the gain is almost 1GB of resident memory.

Merge branch 'colin/remove-sun-path' into 'main'

See merge request isc-projects/bind9!11184

6 months agoremove sun_path field from isc_netaddr
Colin Vidal [Thu, 30 Oct 2025 18:37:05 +0000 (19:37 +0100)] 
remove sun_path field from isc_netaddr

The sun_path field is not used anymore, and consumes over a hundred
bytes for every isc_netaddr_t object. Remove it.

As isc_netaddr_t is used in cfg_obj_t, in some huge configuration trees
(e.g., a million zones), the gain is almost 1GB of resident memory.

6 months agonew: usr: New "rndc showconf" command
Colin Vidal [Wed, 29 Oct 2025 22:49:58 +0000 (23:49 +0100)] 
new: usr: New "rndc showconf" command

The new `rndc showconf` command prints the running server configuration. There are three options:
- `rndc showconf -user` displays the user configuration (i.e., the contents of `named.conf`).
- `rndc showconf -builtin` displays the default settings, similar to `named -H`.
- `rndc showconf -effective` displays the effective configuration. This is the merged combination of the `-user` and `-builtin` configurations.

Closes #1075

Merge branch 'colin/effective-config-rndc' into 'main'

See merge request isc-projects/bind9!11123

6 months agoadd system test for rndc showconf
Colin Vidal [Tue, 21 Oct 2025 10:10:34 +0000 (12:10 +0200)] 
add system test for rndc showconf

Add system tests covering the rndc showconf command. It doesn't
attempt to check the whole effective configuration (as any change to the
builtin configuration would break it) but instead ensures that some parts
of the user config are present, as well as some parts of the builtin
config as well.

It also checks that the effective config (in this context of running
named instance) is about static configuration: a newly added zone is not
visible in the effective configuration.

6 months agoimplement "rndc showconf"
Evan Hunt [Fri, 24 Oct 2025 07:42:33 +0000 (00:42 -0700)] 
implement "rndc showconf"

add a new rndc command to dump server configuration info:
- "rndc showconf -user" dumps the contents of named.conf
- "rndc showconf -builtin" dumps named_g_defaltconfig
- "rndc showconf -effective" dumps the effective configuration,
  i.e., the merger of the builtin and the user configurations.

6 months agorefactor newzones configuration
Evan Hunt [Thu, 23 Oct 2025 20:44:56 +0000 (13:44 -0700)] 
refactor newzones configuration

instead of using an opaque ns_cfgctx pointer to store the configuration
data to be used by addzone and modzone, there are now fields in the
dns_view object to store the view configuration and LMDB database
environment. the global configuration is now stored in the named_server
object, along with the ACL context.

6 months agonew: usr: named-checkconf -e prints the effective configuration
Colin Vidal [Wed, 29 Oct 2025 22:49:37 +0000 (23:49 +0100)] 
new: usr: named-checkconf -e prints the effective configuration

The new `named-checkconf -e` option prints the effective server configuration, including all the default settings, that would result from loading the specified configuration file into `named`.

Closes #2798

Merge branch 'colin/effective-config-checkconf' into 'main'

See merge request isc-projects/bind9!11122

6 months agoadd system test for named-checkconf -e
Colin Vidal [Tue, 21 Oct 2025 09:53:56 +0000 (11:53 +0200)] 
add system test for named-checkconf -e

Add a system test checking the command line switch -e of
named-checkconf. The test doesn't care about the whole output of the
effective configuration (in particular to avoid breaking the test for
each default statement that would change) but instead just ensure the
effective configuration is actually returned by checking the presence of
the _bind chaos builtin view as well a user provided view and option
change.

6 months agonamed-checkconf -e prints effective config
Colin Vidal [Tue, 21 Oct 2025 09:53:33 +0000 (11:53 +0200)] 
named-checkconf -e prints effective config

New command line switch `-e` introduced to `named-checkconf`. It acts
like `-p` but instead it print the effective configuration rather than
the user configuration.

6 months agochg: dev: Load the effective configuration
Colin Vidal [Wed, 29 Oct 2025 22:48:38 +0000 (23:48 +0100)] 
chg: dev: Load the effective configuration

The configuration mechanism for `named` has been changed: instead of loading the user configuration from `named.conf` and then, statement-by-statement, picking values from there or from the built-in default configuration, we now merge the user configuration and the default configuration together, then pass the resulting "effective configuration" to `apply_configuration()`.

The new `cfg_effective_config()` function takes a user configuration tree and the built-in default configuration tree, and returns a new effective configuration tree. It works by cloning the user configuration (see !11124) into the effective tree, then walking through the clauses defined in it. If a clause is not in the user config but is present in the defaults, the default version is cloned and attached to the effective tree. If a clause is in both trees, then depending on the statement semantics, either the user configuration overrides the default, or the two are merged. Because these semantics are now handled before `apply_configuration()` runs, that function has been substantially simplified.

Future MRs will enable the effective configuration to be printed, either by `rndc` (!11123) or `named-checkconf` (!11122). The default configuration has been moved to an include file which is accessible to both `named` and `named-checkconf`.

Merge branch 'colin/effective-config-internal' into 'main'

See merge request isc-projects/bind9!11121

6 months agoparser: add VALID_CFGOBJ macro
Colin Vidal [Tue, 28 Oct 2025 18:04:54 +0000 (19:04 +0100)] 
parser: add VALID_CFGOBJ macro

In order to harden `cfg_obj_t` usage now the configuration tree is
manipulated in various ways (cloned, merged, etc.), this introduce the
VALID_CFGOBJ macro to check the validity of a `cfg_obj_t` node.

6 months agofix delv when using the builtin trust-anchors
Colin Vidal [Mon, 13 Oct 2025 16:35:52 +0000 (18:35 +0200)] 
fix delv when using the builtin trust-anchors

Since the builtin trust-anchors are now called `builtin-trust-anchors`,
delv needs specific handling in order to be able to parse those when
they are used.

Before, delv was simply parsing a single clause (either in the case of
an overriden trust-anchors value from bindkeys file or by simply reading
the builtin value). But since the name changed, the same code can't be
shared and the builtin version is expected to be in a map.

6 months agonamed -V doesn't need to parse default options
Evan Hunt [Sat, 25 Oct 2025 07:20:58 +0000 (00:20 -0700)] 
named -V doesn't need to parse default options

instead of parsing the default configuration to extract the
geoip-directory value, we can just construct the value the same way
it's done for the defaults.

6 months agointroduce default config builtin-root-anchors
Colin Vidal [Mon, 13 Oct 2025 14:00:17 +0000 (16:00 +0200)] 
introduce default config builtin-root-anchors

Since the effective configuration tree is a "merged" configuration tree
from the user and the default configurations, the effective configuration
provides a unique configuration tree used by apply_confiuration() to
configure the server.

However, there is one specific case where the configuration code needs
to differentiate whether the configuration originally came from the
default or the user configuration: the trust-anchors. This is because
the default trust-anchors _have_ to be those for the root zone, and the
one provided by the user can be for any zone. A check enforces this.

In order to keep this difference visible from the configuration code,
with a unique configuration tree, we now introduce a default-only
`builtin-trust-anchors` statement which holds the builtin root
trust-anchors. It can't be used from the user configuration (this would
raise an error), hence it is not documented.

6 months agoenable effective configuration
Colin Vidal [Thu, 16 Oct 2025 15:25:14 +0000 (17:25 +0200)] 
enable effective configuration

The effective configuration now contains the actual named configuration
as a unified user/global single tree instance.  We now provide this to
apply_configuration() instead of the user configuration.

6 months agofix serve-stale system test after moving defconfig
Colin Vidal [Thu, 16 Oct 2025 15:15:50 +0000 (17:15 +0200)] 
fix serve-stale system test after moving defconfig

The serve-stale system test relies on sed accessing the source
file that hard-codes the default configuration. Since it moved from
bin/named/config.c into bin/include/defaultconfig.h, the test needs
the path updated.

6 months agoeffective config: specific check-names case
Colin Vidal [Thu, 16 Oct 2025 15:14:14 +0000 (17:14 +0200)] 
effective config: specific check-names case

There are multiple check-names options provided in the default
configuration, and they must "complete" those provided by the user.
This is now handled when building the effective tree.

6 months agoeffective config: specific prefetch/trigger case
Colin Vidal [Thu, 16 Oct 2025 15:00:43 +0000 (17:00 +0200)] 
effective config: specific prefetch/trigger case

The prefetch statement can be overriden by the user, but the user might
specify the prefetch without the trigger value, which needs to be
pulled from the default configuration. Handle this case by directly
getting the default value if needed from the default configuration when
building the effective configuration tree.

Also take care of keeping the values inside their bounds, and simplify
the server configuration code which then just have to read effective
configuration values.

6 months agoeffective config: specific dnssec-policy case
Colin Vidal [Thu, 16 Oct 2025 14:50:30 +0000 (16:50 +0200)] 
effective config: specific dnssec-policy case

Default dnssec-policies are not overridden by user-provided ones. Add
this specific case to make sure those are kept, and also ensure that the
default dnssec-policy is always in the first position (which is an
implicit requirement in the existing implementation).

Also simplify the server configuration code, as it only needs to build
the list of dnssec-policy based on the effective config list.