]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 months agoStore zone config also on modzone
Matthijs Mekking [Tue, 17 Mar 2026 08:29:10 +0000 (09:29 +0100)] 
Store zone config also on modzone

'rndc modzone' deletes the old configuration. If we don't store the
new zone config, when we do a 'rndc showzone' it will be a failure.

This is not an issue in the 9.21 version, because of the effective
config behavior.

2 months agoDon't call dns_zone_setadded() on modify
Matthijs Mekking [Fri, 13 Mar 2026 10:56:31 +0000 (11:56 +0100)] 
Don't call dns_zone_setadded() on modify

If we are modifiying the zone, the zone must have been added before.
Don't overwrite this value on modifications.

Also it feels cleaner to pass added=false to configure_zone() in
do_modzone().

(cherry picked from commit 780872e07eaa735c215765da570d2f1f78bfade7)

2 months agoOnly lock view->newzone.lock if not already locked
Matthijs Mekking [Fri, 13 Mar 2026 10:52:47 +0000 (11:52 +0100)] 
Only lock view->newzone.lock if not already locked

Some code paths try to lock an already locked view->newzone.lock.

For example, do_modzone() aqcuires the lock and then calls
delete_zoneconf(), that wants to acquire the same lock.

Add a parameter to delete_zoneconf() that informs the function if the
lock has already been acquired.

(cherry picked from commit 71587b0816a9458895aaa14a85539acd91afda38)

2 months agoTest showzone and modzone on configured zone
Matthijs Mekking [Fri, 13 Mar 2026 10:13:35 +0000 (11:13 +0100)] 
Test showzone and modzone on configured zone

Add test cases for 'rndc showzone' and 'rndc modzone' on a zone
that was configured in named.conf. This should not crash.

(cherry picked from commit 900127c4601382d028af1042db44c36aae54d9fa)

2 months ago[9.20] fix: dev: Clear errno correctly
Mark Andrews [Tue, 17 Mar 2026 01:12:01 +0000 (12:12 +1100)] 
[9.20] fix: dev:  Clear errno correctly

Zero errno before calling strtol.

Closes #5773

Backport of MR !11625

Merge branch 'backport-5773-clear-errno-correctly-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11703

2 months agoClear errno before calling strtol
Mark Andrews [Wed, 4 Mar 2026 06:51:09 +0000 (17:51 +1100)] 
Clear errno before calling strtol

The previous code was incorrectly clearing errno after calling
strtol but before testing the result rather than clearing it and
then calling strtol so that changes to errno can be correctly
determined.

(cherry picked from commit d3ffa1f0073899a96e478906fff5af31eba33784)

2 months ago[9.20] fix: doc: Fix keytag typos in DNSSEC guide
Matthijs Mekking [Mon, 16 Mar 2026 16:55:43 +0000 (16:55 +0000)] 
[9.20] fix: doc: Fix keytag typos in DNSSEC guide

The key identifiers in the comments did not match those in the
output.

Closes #5785

Backport of MR !11634

Merge branch 'backport-5785-dnssec-guide-patch-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11700

2 months agoFix keytag typos in DNSSEC guide
Ethan Meng [Tue, 3 Mar 2026 19:03:51 +0000 (13:03 -0600)] 
Fix keytag typos in DNSSEC guide

The key identifiers in the comments did not match those in the
output.

(cherry picked from commit a2b36d4bcb029604b19fe9a3895a05a475156255)

2 months ago[9.20] fix: dev: Fix use-after-free in xfrin_recv_done
Ondřej Surý [Mon, 16 Mar 2026 11:00:13 +0000 (12:00 +0100)] 
[9.20] fix: dev: Fix use-after-free in xfrin_recv_done

Move the LIBDNS_XFRIN_RECV_DONE probe execution before dns_xfrin_detach
in xfrin_recv_done.

Previously, dns_xfrin_detach was called before the trace probe, which
could free the xfr object.  Because the accessed member xfr->info is an
embedded array, the expression evaluates via pointer arithmetic rather
than a direct memory dereference.  Although this prevents a reliable
crash in practice, it technically remains a use-after-free issue.
Reorder the statements to ensure the transfer context is fully valid
when the probe executes.

Closes #5786

Backport of MR !11632

Merge branch 'backport-5786-fix-dtrace-after-free-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11694

2 months agoFix use-after-free in xfrin_recv_done
Ondřej Surý [Wed, 4 Mar 2026 16:08:50 +0000 (17:08 +0100)] 
Fix use-after-free in xfrin_recv_done

Move the LIBDNS_XFRIN_RECV_DONE probe execution before dns_xfrin_detach
in xfrin_recv_done.

Previously, dns_xfrin_detach was called before the trace probe, which
could free the xfr object.  Because the accessed member xfr->info is an
embedded array, the expression evaluates via pointer arithmetic rather
than a direct memory dereference.  Although this prevents a reliable
crash in practice, it technically remains a use-after-free issue.
Reorder the statements to ensure the transfer context is fully valid
when the probe executes.

(cherry picked from commit e57245ee81a98b27f10b7b61e4cc5251a0c9f8a3)

2 months ago[9.20] chg: dev: Exclude named.args.j2 and system test README files from license...
Colin Vidal [Mon, 16 Mar 2026 10:59:01 +0000 (11:59 +0100)] 
[9.20] chg: dev: Exclude named.args.j2 and system test README files from license header checks

Exclude named.args.j2 files from license header checks so named.args can
be generated from Jinja templates. Also exclude system test README files
from the license header checks.

Backport of MR !11690

Merge branch 'backport-colin/reuse-namedargs-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11696

2 months agoExcluse system test README files from license header checks
Colin Vidal [Mon, 16 Mar 2026 09:29:34 +0000 (10:29 +0100)] 
Excluse system test README files from license header checks

Exclude README* files in system test directories from license header
checks.

(cherry picked from commit c77c4992549432b3d255f433db9a4c0f6fc7b5f3)

2 months agoExclude named.args.j2 files from license header checks
Colin Vidal [Fri, 13 Feb 2026 08:37:58 +0000 (09:37 +0100)] 
Exclude named.args.j2 files from license header checks

Exclude named.args.j2 files from license header checks so named.args can
be generated from Jinja templates.

(cherry picked from commit 63290c9e4e0bf2ba509d52984221f4b8e4e3f77e)

2 months ago[9.20] fix: dev: Fix OpenSSL 4 compatibility issue when calling X509_get_subject_name()
Arаm Sаrgsyаn [Mon, 16 Mar 2026 10:57:00 +0000 (10:57 +0000)] 
[9.20] fix: dev: Fix OpenSSL 4 compatibility issue when calling X509_get_subject_name()

Starting from OpenSSL 4 the the X509_get_subject_name() function
returns a 'const' pointer to a name instead of a regular pointer.
Duplicate the name before operating on it, then free it.

Closes #5807

Backport of MR !11676

Merge branch 'backport-5807-openssl-4-X509_get_subject_name-compat-fix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11692

2 months agoOpenSSL 4 compatibility fix
Aram Sargsyan [Thu, 12 Mar 2026 13:10:38 +0000 (13:10 +0000)] 
OpenSSL 4 compatibility fix

Starting from OpenSSL 4 the the X509_get_subject_name() function
returns a 'const' pointer to a name instead of a regular pointer.
Duplicate the name before operating on it, then free it.

(cherry picked from commit 336c523b7980895c8f43cbb758dd21d2176650f8)

2 months ago[9.20] fix: dev: Fix couple of reference counting bugs
Ondřej Surý [Mon, 16 Mar 2026 10:54:05 +0000 (11:54 +0100)] 
[9.20] fix: dev: Fix couple of reference counting bugs

Fix missing detach/free on error paths.

Backport of MR !11666

Merge branch 'backport-ondrej/fix-reference-counting-errors-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11691

2 months agoFix KASP key leaks on keystore lookup failure
Ondřej Surý [Sat, 14 Mar 2026 11:54:50 +0000 (12:54 +0100)] 
Fix KASP key leaks on keystore lookup failure

In both cfg_kasp_fromconfig() and cfg_kasp_builtinconfig(), the
newly allocated KASP key was not destroyed when the keystore
lookup failed.

(cherry picked from commit df1993611bae62ad0267d8652d599b4158f3e9a9)

2 months agoFix missing server socket detach in TLS accept error path
Ondřej Surý [Sat, 14 Mar 2026 11:54:27 +0000 (12:54 +0100)] 
Fix missing server socket detach in TLS accept error path

When TLS creation fails in tlslisten_acceptcb(), tlssock->server
was not detached before detaching tlssock itself.

(cherry picked from commit 2ab3d7c0757ef8dc3d7a979bad1443a9454e8f55)

2 months agoSimplify checkds_create() to return void
Ondřej Surý [Sat, 14 Mar 2026 11:53:51 +0000 (12:53 +0100)] 
Simplify checkds_create() to return void

Since memory allocation never fails in BIND 9, checkds_create() cannot
fail.  Change it to return void and use designated initializers,
removing error handling at all call sites.

(cherry picked from commit 63d3c1f58a347d7d15c1e5477c6f9793cf139787)

2 months agoFix cb_args memory leak in ns_query() error path
Ondřej Surý [Sat, 14 Mar 2026 11:53:29 +0000 (12:53 +0100)] 
Fix cb_args memory leak in ns_query() error path

Initialize cb_args to NULL and free it in the cleanup path so it
is not leaked when the function fails after allocation.

(cherry picked from commit d7e1013741e3921f0f18246d15ef6f800ada77a2)

2 months agoFix TSIG key and transport leaks in zone_notify() error paths
Ondřej Surý [Sat, 14 Mar 2026 11:53:03 +0000 (12:53 +0100)] 
Fix TSIG key and transport leaks in zone_notify() error paths

Two 'goto next' paths in zone_notify() skipped detaching the TSIG
key and transport, leaking them on TLS configuration failure and
when the destination address is disabled.

(cherry picked from commit 1505cb1c24fcbfcf43b1a1de6957c73afacccdd1)

2 months agoFix memory leak in ixfr_commit() error path
Ondřej Surý [Sat, 14 Mar 2026 11:52:07 +0000 (12:52 +0100)] 
Fix memory leak in ixfr_commit() error path

The 'data' allocation was not freed when reaching the cleanup
label with an error result.

(cherry picked from commit 80fae7a4b7d8f9aa5aedb5f5ad34f90ce1ad3e77)

2 months agoFix memory context leak in dns_client_resolve() error path
Ondřej Surý [Sat, 14 Mar 2026 11:46:05 +0000 (12:46 +0100)] 
Fix memory context leak in dns_client_resolve() error path

Use isc_mem_putanddetach() instead of isc_mem_put() to properly
detach the attached memory context stored in resarg->mctx.

(cherry picked from commit d0165070c7f11e09498ad7c8e19ada7eea1fa044)

2 months ago[9.20] fix: dev: Fix resquery reference imbalance on TCP connect failure
Ondřej Surý [Sun, 15 Mar 2026 03:33:44 +0000 (04:33 +0100)] 
[9.20] fix: dev: Fix resquery reference imbalance on TCP connect failure

In fctx_query(), resquery_ref(query) is called before
dns_dispatch_connect() in anticipation of the resquery_connected()
callback consuming the reference.  When dns_dispatch_connect() fails
synchronously on TCP (e.g. from dns_transport_get_tlsctx() failing
in tcp_dispatch_connect()), the connect callback is never scheduled,
so the extra reference is never consumed.  This has been fixed.

Backport of MR !11640

Merge branch 'backport-ondrej/fix-resquery-refcount-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11656

2 months agoFix resquery reference imbalance on TCP connect failure
Ondřej Surý [Fri, 6 Mar 2026 16:06:24 +0000 (17:06 +0100)] 
Fix resquery reference imbalance on TCP connect failure

In fctx_query(), resquery_ref(query) is called before
dns_dispatch_connect() in anticipation of the resquery_connected()
callback consuming the reference.

When dns_dispatch_connect() fails synchronously on TCP (e.g. from
dns_transport_get_tlsctx() failing in tcp_dispatch_connect()), the
connect callback is never scheduled, so the extra reference is never
consumed.  The error path then tears down the query via manual cleanup
(isc_mem_put) without going through the refcount destructor, leaving
the reference imbalanced.

Fix by dropping the extra reference on the error path, just after
dns_dispatch_done() which cleans up the dispatch entry.

(cherry picked from commit 2da669490ca94b9617257a25d93a52ed67dfdd14)

2 months agoFix copy-paste typos in dns_dispatchmgr comments
Ondřej Surý [Fri, 6 Mar 2026 16:06:16 +0000 (17:06 +0100)] 
Fix copy-paste typos in dns_dispatchmgr comments

The v6ports and nv6ports fields are documented as "available ports
for IPv4" instead of "IPv6".

(cherry picked from commit 0d28e1bed26c9828293ef786daf5574f7f31b918)

2 months ago[9.20] fix: usr: Fix a possible deadlock in RPZ processing
Ondřej Surý [Sat, 14 Mar 2026 13:19:03 +0000 (14:19 +0100)] 
[9.20] fix: usr: Fix a possible deadlock in RPZ processing

The :iscman:`named` process could hang when processing a
maliciously crafted update for a response policy zone (RPZ).
This has been fixed.

Closes #5775

Backport of MR !11659

Merge branch 'backport-5775-rpz-del_name-deadlock-fix-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11687

2 months agoFix a bug in rpz.c:del_name()
Aram Sargsyan [Wed, 11 Mar 2026 12:39:51 +0000 (12:39 +0000)] 
Fix a bug in rpz.c:del_name()

When the dns_qp_getname() call returns an error the del_name() function
just returns without cleaning up the trasnaction.

Instead of returning, jump to a new label 'done:' similar to the code
written in the add_nm() function.

(cherry picked from commit 4df5b9ac32fd3adb9bd1dfa94a778edd1cda04c5)

2 months ago[9.20] fix: dev: Fix memory leak in dns_catz_options_setdefault() for zonedir
Ondřej Surý [Sat, 14 Mar 2026 09:56:16 +0000 (10:56 +0100)] 
[9.20] fix: dev: Fix memory leak in dns_catz_options_setdefault() for zonedir

When defaults->zonedir is set, opts->zonedir is unconditionally
overwritten without freeing the previous value. This leaks memory
on every catalog zone update when zonedir defaults are configured.

Free the existing opts->zonedir before replacing it.

Backport of MR !11660

Merge branch 'backport-ondrej/fix-memory-leak-in-dns_catz_options_setdefault-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11685

2 months agoFix memory leak in dns_catz_options_setdefault() for zonedir
Ondřej Surý [Wed, 11 Mar 2026 12:17:32 +0000 (13:17 +0100)] 
Fix memory leak in dns_catz_options_setdefault() for zonedir

When defaults->zonedir is set, opts->zonedir is unconditionally
overwritten without freeing the previous value. This leaks memory
on every catalog zone update when zonedir defaults are configured.

Free the existing opts->zonedir before replacing it.

(cherry picked from commit 5cd17c8adc2720b26e8d76599b7f7786f1c854ad)

2 months ago[9.20] fix: usr: Fix intermittent named crashes during asynchronous zone operations
Ondřej Surý [Sat, 14 Mar 2026 08:43:54 +0000 (09:43 +0100)] 
[9.20] fix: usr: Fix intermittent named crashes during asynchronous zone operations

Asynchronous zone loading and dumping operations occasionally dispatched tasks
to the wrong internal event loop. This threading violation triggered internal
safety assertions that abruptly terminated named. Strict loop affinity is now
enforced for these tasks, ensuring they execute on their designated threads
and preventing the crashes.

Closes #4882

Backport of MR !11655

Merge branch 'backport-4882-run-rndc-zone-commands-on-correct-loop-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11684

2 months agoDispatch async work jobs from the correct loop
Ondřej Surý [Tue, 10 Mar 2026 17:25:54 +0000 (18:25 +0100)] 
Dispatch async work jobs from the correct loop

Refactor dns_loadctx_t and dns_dumpctx_t to use standard
ISC_REFCOUNT_DECL and ISC_REFCOUNT_IMPL macros, retiring the
redundant manual attach and detach implementations.

Introduce dns_loadctx_enqueue() and dns_dumpctx_enqueue() to
ensure compliance with the new strict loop affinity in
isc_work_enqueue(). If the current loop does not match the
target loop, the enqueue operation is safely bounced to the
correct thread via isc_async_run().

(cherry picked from commit e7c550730acecd87a7dd0d195d7752fb97e10087)

2 months agoEnforce isc_work enqueue loop affinity
Ondřej Surý [Tue, 10 Mar 2026 17:25:37 +0000 (18:25 +0100)] 
Enforce isc_work enqueue loop affinity

Add a REQUIRE(isc_loop() == loop) assertion to isc_work_enqueue()
to strictly enforce that work is enqueued from the loop it is
assigned to. This loudly prohibits cross-thread queue manipulation
before it inevitably turns into a concurrency debugging nightmare.

(cherry picked from commit f1311d2d196d381b2170c4b3d54262874a5d424e)

2 months agochg: doc: Set up version for BIND 9.20.22
Michał Kępień [Thu, 12 Mar 2026 20:15:19 +0000 (21:15 +0100)] 
chg: doc: Set up version for BIND 9.20.22

Merge branch 'michal/set-up-version-for-bind-9.20.22' into 'bind-9.20'

See merge request isc-projects/bind9!11681

2 months agoUpdate BIND version to 9.20.22-dev
Michał Kępień [Thu, 12 Mar 2026 20:11:29 +0000 (21:11 +0100)] 
Update BIND version to 9.20.22-dev

2 months ago[9.20] new: ci: Add CI jobs to update RPM packages
Michał Kępień [Thu, 12 Mar 2026 20:02:41 +0000 (21:02 +0100)] 
[9.20] new: ci: Add CI jobs to update RPM packages

New CI jobs are added to update the RPM packages in the context of a new
release. To be run only in tag pipelines.

Backport of MR !11677

Merge branch 'backport-andoni/andoni/new-ci-add-job-to-update-rpms-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11678

2 months agoAdd CI jobs to update RPM packages
Andoni Duarte Pintado [Thu, 5 Mar 2026 14:35:36 +0000 (15:35 +0100)] 
Add CI jobs to update RPM packages

New CI jobs are added to update the RPM packages in the context of a new
release. To be run only in tag pipelines.

(cherry picked from commit 985a1e16645282f41e10516f83f48be4dae1fdef)

2 months ago[9.20] new: ci: Automatically manage early access tokens for distros
Petr Špaček [Thu, 12 Mar 2026 13:28:16 +0000 (13:28 +0000)] 
[9.20] new: ci: Automatically manage early access tokens for distros

Backport of MR !11654

Merge branch 'backport-pspacek/distros-tokens-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11674

2 months agoFix a typo in job name
Michał Kępień [Thu, 12 Mar 2026 11:27:36 +0000 (12:27 +0100)] 
Fix a typo in job name

As hinted upon by the comment preceding it, the job preparing packager
notifications was (rather unsurprisingly) supposed to be called
"prepare-packager-notification".  Fix the typo in its name.

(cherry picked from commit 50e18f6720b385f3adf9992e348e966a7f322539)

2 months agoDelete early access token when code is published
Petr Špaček [Tue, 10 Mar 2026 17:04:51 +0000 (18:04 +0100)] 
Delete early access token when code is published

Technically this is not necessary because the token expires in one week
after creation, and new code would have got there only one week before
the next public release, but better be safe than sorry.

Catch is, after_script gets executed even if a job fails or is
canceled. Delete distros token only if publication succeeded.

(cherry picked from commit 98cbde5233c788936f8aeb6231c65db74d9f7fbc)

2 months agoGenerate token for early Git access in prepare-package-notification
Petr Špaček [Tue, 10 Mar 2026 17:01:16 +0000 (18:01 +0100)] 
Generate token for early Git access in prepare-package-notification

(cherry picked from commit 9f323ad040095717d9d6708a66cd6ae745aca741)

2 months ago[9.20] fix: nil: Set length in dns_rdata_in_dhcid structure
Mark Andrews [Thu, 12 Mar 2026 10:03:39 +0000 (21:03 +1100)] 
[9.20] fix: nil: Set length in dns_rdata_in_dhcid structure

tostruct_in_dhcid was not setting the length field in the
dns_rdata_in_dhcid structure. This has been fixed.

Fixes #5796

Backport of MR !11668

Merge branch 'backport-marka-set-dhcid-length-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11672

2 months agoSet length in dns_rdata_in_dhcid structure
Mark Andrews [Wed, 11 Mar 2026 21:51:51 +0000 (08:51 +1100)] 
Set length in dns_rdata_in_dhcid structure

tostruct_in_dhcid was not setting the length field in the
dns_rdata_in_dhcid structure.

(cherry picked from commit cfa21d1e8bfa1efc952ae3e415d30e492856e1ea)

2 months ago[9.20] fix: doc: Expand blackhole description
Mark Andrews [Thu, 12 Mar 2026 02:10:28 +0000 (13:10 +1100)] 
[9.20] fix: doc: Expand blackhole description

Clarify the behavior of negated addresses within the `blackhole`
statement to prevent common configuration misunderstandings.

Closes #5733

Backport of MR !11541

Merge branch 'backport-5733-expand-blackhole-description-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11670

2 months agoExpand blackhole description
Ondřej Surý [Thu, 26 Feb 2026 16:13:04 +0000 (17:13 +0100)] 
Expand blackhole description

Clarify the behavior of negated addresses within the `blackhole`
statement to prevent common configuration misunderstandings.

(cherry picked from commit 2b23c7011e0b6f2a2deaca17eb90c34386bb027d)

2 months ago[9.20] fix: test: Bump xfer timeout to 30 seconds
Michal Nowak [Tue, 10 Mar 2026 15:13:34 +0000 (16:13 +0100)] 
[9.20] fix: test: Bump xfer timeout to 30 seconds

Closes #5792

Backport of MR !11649

Merge branch 'backport-5792-xfer-test-bump-timeout-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11652

2 months agoBump xfer timeout to 30 seconds
Michal Nowak [Tue, 10 Mar 2026 10:42:38 +0000 (11:42 +0100)] 
Bump xfer timeout to 30 seconds

Enabling ans6 responses and xfr-and-reconfig zone reload sometimes takes
more time on FreeBSD than the default timeout allows; bump it to 30
seconds.

(cherry picked from commit 77a7430a5f122050d375517989b6d490c38ca0ed)

2 months ago[9.20] chg: ci: Re-enable shotgun runs for nightlies and tags
Nicki Křížek [Mon, 9 Mar 2026 17:02:50 +0000 (18:02 +0100)] 
[9.20] chg: ci: Re-enable shotgun runs for nightlies and tags

The recent rewrite of DNS Shotgun infrastructure might've improved the
prior instability. In order to evaluate, re-enable the regular shotgun
pipelines to gather data.

Backport of MR !11506

Merge branch 'backport-nicki/ci-shotgun-enable-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11644

2 months agoRe-enable shotgun runs
Nicki Křížek [Thu, 29 Jan 2026 10:10:10 +0000 (11:10 +0100)] 
Re-enable shotgun runs

Make the shotgun pipelines on-demand with 5 samples (and no retry) by
defautl. MRs are compared to their base, while other sources (triggers,
web, schedule...) are compared against the latest released version.

For schedules, run the shotgun pipelines on Monday morning only, but
with the increased number of samples. This should provide useful data
without too many false positives.

(cherry picked from commit f2f255d67eebe26ca836ecf53810ec1a6ff37671)

2 months ago[9.20] chg: test: Log dnspython queries after .to_wire() is called
Nicki Křížek [Mon, 9 Mar 2026 14:54:39 +0000 (15:54 +0100)] 
[9.20] chg: test: Log dnspython queries after .to_wire() is called

Some dns message modifications like TSIG happen only after .to_wire() is
called on the message. To ensure there isn't a discrepancy between what
has been logged and what has been sent, log the query after
dns.query.udp() is executed (which calls .to_wire() on the message).

Backport of MR !11623

Merge branch 'backport-nicki/pytest-log-querymsg-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11642

2 months agoLog dnspython queries after .to_wire() is called
Nicki Křížek [Tue, 3 Mar 2026 12:37:14 +0000 (13:37 +0100)] 
Log dnspython queries after .to_wire() is called

Some dns message modifications like TSIG happen only after .to_wire() is
called on the message. To ensure there isn't a discrepancy between what
has been logged and what has been sent, log the query after
dns.query.udp() is executed (which calls .to_wire() on the message).

Co-Authored-By: Štěpán Balážik <stepan@isc.org>
(cherry picked from commit a22e03f71b38674ce28cb0c026a2bb7d50d93ab7)

2 months ago[9.20] new: ci: Add a job updating the Docker image for a specific release
Andoni Duarte [Fri, 6 Mar 2026 09:28:35 +0000 (09:28 +0000)] 
[9.20] new: ci: Add a job updating the Docker image for a specific release

Add a new CI job that updates the Docker image for a specific release.

Backport of MR !11564

Merge branch 'backport-andoni/update-bind9-docker-images-for-release-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11637

2 months agoAdd job to update BIND9 Docker images for release
Andoni Duarte Pintado [Thu, 19 Feb 2026 09:04:51 +0000 (10:04 +0100)] 
Add job to update BIND9 Docker images for release

This commit adds a new CI job to update the BIND9 version in the
isc-projects/bind9-docker project, which will cause the docker images
to be rebuilt for release. Previously a manual step.

A notification is sent to the relevant Mattermost channel.

(cherry picked from commit 0ad724558ec0e66b3125250a3ac92197a9b864f6)

3 months ago[9.20] new: ci: Add LLVM 22
Michal Nowak [Wed, 4 Mar 2026 11:56:17 +0000 (12:56 +0100)] 
[9.20] new: ci: Add LLVM 22

Backport of MR !11627

Merge branch 'backport-mnowak/llvm-22-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11628

3 months agoIgnore clang-format-22 reformatting commits
Michal Nowak [Wed, 4 Mar 2026 09:58:15 +0000 (10:58 +0100)] 
Ignore clang-format-22 reformatting commits

(cherry picked from commit 01d16e049e7673724800661fbbe7d75c4fe0e591)

3 months agoUse clang-format-22 to update formatting
Michal Nowak [Wed, 4 Mar 2026 11:17:00 +0000 (12:17 +0100)] 
Use clang-format-22 to update formatting

(cherry picked from commit 239464f27643bf609e9c0ad79ab2d597ccbb2280)

3 months agoAdd LLVM 22
Michal Nowak [Tue, 24 Feb 2026 19:56:54 +0000 (20:56 +0100)] 
Add LLVM 22

(cherry picked from commit ffd7636e79023eadeacf52cf88c471c885f7be88)

3 months ago[9.20] fix: ci: Fix .respdiff-recent-named anchor to work when the ABI changes
Štěpán Balážik [Tue, 3 Mar 2026 08:03:40 +0000 (08:03 +0000)] 
[9.20] fix: ci: Fix .respdiff-recent-named anchor to work when the ABI changes

Previously, on 9.20 and 9.18, both builds (reference and the version
being tested) would use the same .so files which lead to a crash if the
ABI changed.

Use `git worktree` to get completely separate build environment for the
reference version.

This is not a problem on 9.21 as Meson is smart and covers this mistake,
but apply the fix to it as well for consistency.

This also is not a problem on non-MR pipelines: the latest released version
was used as a reference there, so the .so versions would differ.

See the 9.20 pre-backport branch and the jobs:

- Broken: https://gitlab.isc.org/isc-projects/bind9/-/jobs/6951217
- Fixed: https://gitlab.isc.org/isc-projects/bind9/-/jobs/6951220

Backport of MR !11616

Merge branch 'backport-stepan/respdiff-fails-on-abi-breakage-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11619

3 months agoFix .respdiff-recent-named anchor to work when the ABI changes
Štěpán Balážik [Mon, 2 Mar 2026 14:54:53 +0000 (15:54 +0100)] 
Fix .respdiff-recent-named anchor to work when the ABI changes

Previously, on 9.20 and 9.18, both builds (reference and the version
being tested) would use the same .so files which lead to a crash if the
ABI changed.

Use `git worktree` to get completely separate build environment for the
reference version.

This is not a problem on 9.21 as Meson is smart and covers this mistake,
but apply the fix to it as well for consistency.

(cherry picked from commit a719341314d5fdc0a7b61082aea2fac6db26a8b6)

3 months ago[9.20] fix: usr: Resolve "key defined in view is not found"
Colin Vidal [Sun, 1 Mar 2026 19:01:20 +0000 (20:01 +0100)] 
[9.20] fix: usr: Resolve "key defined in view is not found"

Commit `2956e4fc` hardened the `key` name check when used in `primaries` to reject the configuration if the key was not defined, rather than simply checking whether the key name was correctly formed.

However, the key name check didn't include the view configuration, causing keys not to be recognized if they were defined inside the view and not at the global level.  This regression is now fixed.

Backport of MR !11588

Closes #5761

Merge branch 'backport-5761-key-view-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11613

3 months agoadd checkconf test with key defined inside a view
Colin Vidal [Mon, 23 Feb 2026 18:36:32 +0000 (19:36 +0100)] 
add checkconf test with key defined inside a view

A configuration where a key was defined inside a view, then used in a
`primary` statement wasn't covered. This is now fixed.

(cherry picked from commit d8f46b09a76632c20803f36d766615958897a7c4)

3 months agocheckconf: check key existence in views
Colin Vidal [Mon, 23 Feb 2026 18:36:19 +0000 (19:36 +0100)] 
checkconf: check key existence in views

Commit `2956e4fc45b3c2142a3351682d4200647448f193` hardened the `key`
name check when used in `primaries` to reject the configuration if
the key was not defined, rather than simply checking whether the
key name was correctly formed.

However, the key name check didn't include the view configuration,
causing keys not to be recognized if they were defined inside the
view and not at the global level.  This regression is now fixed.

(cherry picked from commit b90399ebdcd97dba7938c872961b6f60f6db623f)

3 months agoMerge tag 'v9.20.20' into bind-9.20
Michał Kępień [Fri, 27 Feb 2026 12:20:20 +0000 (12:20 +0000)] 
Merge tag 'v9.20.20' into bind-9.20

3 months agoUpdate BIND version for release v9.20.20
Michał Kępień [Thu, 26 Feb 2026 20:53:41 +0000 (21:53 +0100)] 
Update BIND version for release

3 months agonew: doc: Prepare documentation for BIND 9.20.20
Michał Kępień [Thu, 26 Feb 2026 20:50:29 +0000 (21:50 +0100)] 
new: doc: Prepare documentation for BIND 9.20.20

Merge branch 'michal/prepare-documentation-for-bind-9.20.20' into 'v9.20.20-release'

See merge request isc-private/bind9!933

3 months agoAdd release note for GL !11565
Michał Kępień [Thu, 26 Feb 2026 20:29:38 +0000 (21:29 +0100)] 
Add release note for GL !11565

3 months agoReorder release notes
Michał Kępień [Thu, 26 Feb 2026 20:29:38 +0000 (21:29 +0100)] 
Reorder release notes

3 months agoTweak and reword release notes
Michał Kępień [Thu, 26 Feb 2026 20:29:38 +0000 (21:29 +0100)] 
Tweak and reword release notes

3 months agoPrepare release notes for BIND 9.20.20
Michał Kępień [Thu, 26 Feb 2026 20:29:38 +0000 (21:29 +0100)] 
Prepare release notes for BIND 9.20.20

3 months agoGenerate changelog for BIND 9.20.20
Michał Kępień [Thu, 26 Feb 2026 20:29:38 +0000 (21:29 +0100)] 
Generate changelog for BIND 9.20.20

3 months agochg: doc: Set up version for BIND 9.20.21
Michał Kępień [Thu, 26 Feb 2026 11:02:32 +0000 (12:02 +0100)] 
chg: doc: Set up version for BIND 9.20.21

Merge branch 'michal/set-up-version-for-bind-9.20.21' into 'bind-9.20'

See merge request isc-projects/bind9!11609

3 months agoUpdate BIND version to 9.20.21-dev
Michał Kępień [Thu, 26 Feb 2026 11:00:26 +0000 (12:00 +0100)] 
Update BIND version to 9.20.21-dev

3 months ago[9.20] chg: dev: Implement Fisher-Yates shuffle for nameserver selection
Ondřej Surý [Thu, 26 Feb 2026 08:13:34 +0000 (09:13 +0100)] 
[9.20] chg: dev: Implement Fisher-Yates shuffle for nameserver selection

Replace the two-pass "random start index and wrap around" logic in
fctx_getaddresses_nameservers() with a statistically sound partial
Fisher-Yates shuffle.

The previous implementation picked a random starting node and did two
passes over the linked list to find query candidates. The new logic
introduces fctx_getaddresses_nsorder() to perform an in-place
randomization of indices into a bounded, stack-allocated lookup array
(nsorder) representing the "winning" fetch slots.

The nameserver dataset is now traversed in exactly one sequential pass:
1. Every nameserver is evaluated for local cached data.
2. If the current nameserver's sequential index exists in the randomized
   nsorder array, it is permitted to launch an outgoing network fetch.
3. If not, it is restricted to local lookups via DNS_ADBFIND_NOFETCH.

This guarantees a fair random distribution for outbound queries while
maximizing local cache hits, entirely within O(1) memory and without
the overhead of linked-list pointer shuffling or dynamic allocation.

Closes #5695

Backport of MR !11604

Merge branch 'backport-5695-refactor-the-random-NS-selection-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11606

3 months agoAdd test coverage for nameserver processing limits
Colin Vidal [Wed, 25 Feb 2026 18:01:22 +0000 (19:01 +0100)] 
Add test coverage for nameserver processing limits

Introduce a new system test (nsprocessinglimit) to verify that the
resolver strictly respects outgoing network fetch quotas when presented
with heavily delegated, unresponsive zones.

This test acts as a regression check for the recent Fisher-Yates nameserver
selection refactor.  It sets up an authoritative server delegating a zone
to 23 distinct nameservers (all pointing to unresponsive loopback IPs).

Using dnstap, the test forces a resolution failure and verifies that:
1. The resolver successfully traverses the zone delegation path.
2. The resolver caps the outgoing network queries to the delegated
   nameservers exactly at the processing limit (20 fetches), ensuring
   array boundaries and dynamic fetch quotas are strictly enforced without
   crashing or hanging.

(cherry picked from commit 5274e764c427155b65afd874f98d4a0237126ad1)

3 months agoImplement Fisher-Yates shuffle for nameserver selection
Ondřej Surý [Wed, 25 Feb 2026 15:46:40 +0000 (16:46 +0100)] 
Implement Fisher-Yates shuffle for nameserver selection

Replace the two-pass "random start index and wrap around" logic in
fctx_getaddresses_nameservers() with a statistically sound Fisher-Yates
shuffle.

The previous implementation picked a random starting node and did two
passes over the linked list to find query candidates.  The new logic
extracts the available nameservers into a bounded, stack-allocated array
of dns_rdata_t structures.

This array is then randomized in-place using a Fisher-Yates shuffle.
Finally, the shuffled array is traversed sequentially to launch fetches
until the dynamic quota (fctx->pending_running >= fetches_allowed) is
reached.

This guarantees a fair random distribution for outbound queries while
properly respecting dynamic query limits, entirely within O(1) memory
and without the overhead of linked-list pointer shuffling or multiple
dataset traversals.

(cherry picked from commit 3c33e7d9370006b1599e3d99c0d5fa6a6dad7979)

3 months ago[9.20] fix: nil: Fix log level bug related to keystores
Matthijs Mekking [Wed, 25 Feb 2026 17:05:26 +0000 (17:05 +0000)] 
[9.20] fix: nil: Fix log level bug related to keystores

A debug message that logs a PKCS#11 object has been generated was erroneously
logged at error level. This has been fixed.

Backport of MR !11586

Merge branch 'backport-matthijs-fix-loglevel-keystore-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11601

3 months agoFix log level bug in keystore
Matthijs Mekking [Mon, 23 Feb 2026 09:21:50 +0000 (10:21 +0100)] 
Fix log level bug in keystore

A debug message that logs a PKCS#11 object has been generated was
erroneously logged at error level. This has been fixed.

(cherry picked from commit 5bd6322739b7d711142ded1605af9b527302ebf4)

3 months ago[9.20] fix: ci: Fix generate-tsan-stress-test-configs CI job
Štěpán Balážik [Wed, 25 Feb 2026 16:01:00 +0000 (16:01 +0000)] 
[9.20] fix: ci: Fix generate-tsan-stress-test-configs CI job

In a3d0f43d2 I moved the script that does this to the QA repo and
screwed up the path.

Fix the path and make the job run properly again.

Backport of MR !11599

Merge branch 'backport-stepan/fix-tsan-stress-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11602

3 months agoFix generate-tsan-stress-test-configs CI job
Štěpán Balážik [Tue, 24 Feb 2026 21:31:12 +0000 (22:31 +0100)] 
Fix generate-tsan-stress-test-configs CI job

In a3d0f43d2 I moved the script that does this to the QA repo and
screwed up the path.

Fix the path and make the job run properly again.

(cherry picked from commit 4ed6c4e4e7027e92b3850bbd4b4c4b3f01dc0e3d)

3 months ago[9.20] chg: ci: Rework linting of Python code
Štěpán Balážik [Wed, 25 Feb 2026 13:49:25 +0000 (13:49 +0000)] 
[9.20] chg: ci: Rework linting of Python code

With the Python version bumped to 3.10 and the dependency situation cleared with !11415 it is now time to run linters and formatters on more parts of the Python code that was previously skipped or ignored.

Switch configuration of the various Python-adjacent tools to `pyproject.toml` to ensure that the same configuration is used in CI and locally.

See the individual commits for details on settings changed and linters added.

Tweaks to type checking and enabling more `ruff` lints will come in a subsequent MRs.

Prerequisites:
- bind9-qa!160.
- images!442

Backport of MR !11499

Merge branch 'backport-stepan/python-tooling-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!11574

3 months agoAdd ruff job to CI
Štěpán Balážik [Tue, 10 Feb 2026 19:48:54 +0000 (20:48 +0100)] 
Add ruff job to CI

Run the linter on Python code changes in CI.

(cherry picked from commit 8b0a8dbd8e16652acfc1f72b05f3ada744aa47de)

3 months agoReplace deprecated typing imports
Štěpán Balážik [Tue, 10 Feb 2026 15:12:57 +0000 (16:12 +0100)] 
Replace deprecated typing imports

More specific modules (like collections.abc) can now be used.

Generated with: ruff check --extend-select UP035 --fix

(cherry picked from commit ced002c4ab7b920c9528d315a611a477cb4a9409)

3 months agoClean up imports of dnspython modules
Štěpán Balážik [Mon, 9 Feb 2026 18:22:44 +0000 (19:22 +0100)] 
Clean up imports of dnspython modules

Add a pylint plugin that enforces:
  - There is no bare `import dns` statement.
  - All `dns.<module>` used are explicitly imported.
  - There are no unused `dns.<module>` imports.

Fix all the imports to conform with this check.

(cherry picked from commit d3186c70386040b2f51c08e73f1b850c1a2bcbf1)

3 months agoReplace Optional["T"] with "T | None"
Štěpán Balážik [Fri, 20 Feb 2026 14:03:16 +0000 (15:03 +0100)] 
Replace Optional["T"] with "T | None"

In Python 3.10 strings don't support the | operator, so ruff doesn't
attempt to fix these. Quote the entire type specification to avoid the
typing.Optional import.

Alternatives I considered:
- leaving it as is (only use of Optional in the code base)
- using `from future import __annotations__` (replacing one import with
  another one)

(cherry picked from commit 1d5924c82fcf8f55d339bbf0a40c31e5f10c635e)

3 months agoReplace Optional[T] with T | None
Štěpán Balážik [Mon, 9 Feb 2026 14:46:40 +0000 (15:46 +0100)] 
Replace Optional[T] with T | None

Generated with: ruff check --extend-select UP045 --fix && black .

(cherry picked from commit fe38515ad064637957e1e6e55ed91ed8cb3f8dc4)

3 months agoRemove the rest of Union usages by hand
Štěpán Balážik [Mon, 9 Feb 2026 14:45:58 +0000 (15:45 +0100)] 
Remove the rest of Union usages by hand

These require some manual changes.

(cherry picked from commit cdb74284318d38bf5b3bfd3424a01b042e1a31e0)

3 months agoReplace Union[S, T] with S | T
Štěpán Balážik [Mon, 9 Feb 2026 14:40:36 +0000 (15:40 +0100)] 
Replace Union[S, T] with S | T

Generated with: ruff check --extend-select UP007 --fix && black .

(cherry picked from commit ce9c9a1a9c27fdf1e795494761cd8f8e2dfe21f8)

3 months agoBuilt-in types are now subscriptable
Štěpán Balážik [Mon, 9 Feb 2026 14:33:22 +0000 (15:33 +0100)] 
Built-in types are now subscriptable

Generated with: ruff check --extend-select UP006 --fix

(cherry picked from commit 790745da18fb575ab48b2d5d48bf45e2054528f9)

3 months agoRemove superfluous 'pylint: disable' directives
Štěpán Balážik [Mon, 9 Feb 2026 14:10:36 +0000 (15:10 +0100)] 
Remove superfluous 'pylint: disable' directives

Some of these have been fixed already, fix the rest.

(cherry picked from commit 08f5e5ebd1ad4321579d7a685fb8c512793eeeef)

3 months agoRemove unused imports
Štěpán Balážik [Mon, 9 Feb 2026 13:42:48 +0000 (14:42 +0100)] 
Remove unused imports

Generated with: ruff check --extend-select F401 --fix

(cherry picked from commit b00f16f0269bf8b27b8aa6af17f5b1705b6d9b48)

3 months agoSet pytestmark explicitly in rollover* and nsec3* tests
Štěpán Balážik [Thu, 5 Feb 2026 12:24:46 +0000 (13:24 +0100)] 
Set pytestmark explicitly in rollover* and nsec3* tests

Importing pytestmark confuses static analysis tools as they flag it as
unused.

(cherry picked from commit 7178c97e5c3aae200e54c3663a1b9216f5f83b03)

3 months agoMake default_algorithm accessible through a fixture and method
Štěpán Balážik [Wed, 4 Feb 2026 17:17:17 +0000 (18:17 +0100)] 
Make default_algorithm accessible through a fixture and method

Importing pytest fixture trips up static analysis tools, so move
default_algorithm to conftest.py and use it instead of os.environ
accesses in various system tests.

For use outside test function, use Algorithm.default().

(cherry picked from commit ef21b779124e2edea914b75a1f7bbf963fbaafb4)

3 months agoDefine __all__ in __init__.py files
Štěpán Balážik [Wed, 28 Jan 2026 17:49:34 +0000 (18:49 +0100)] 
Define __all__ in __init__.py files

Fix ruff's F401 unused-import errors in these files.

Also sort them with: ruff check --extend-select RUF022 --fix.

(cherry picked from commit 2b9c5ccd77ac47097bf364b2d3aa51ac9e183a28)

3 months agoAutomatically sort imports in Python code
Štěpán Balážik [Sat, 21 Feb 2026 12:46:34 +0000 (13:46 +0100)] 
Automatically sort imports in Python code

Generated with: ruff check --extend-select I --fix (with the changes to
pyproject.toml applied).

(cherry picked from commit ffd5b6ac262e8838dfc10790c6a67f545405a594)

3 months agoRemove unneeded pylint: disable=import-error
Štěpán Balážik [Sat, 21 Feb 2026 12:36:29 +0000 (13:36 +0100)] 
Remove unneeded pylint: disable=import-error

Paths are now correctly set up for pylint.

3 months agoLint code in doc directory
Štěpán Balážik [Wed, 28 Jan 2026 16:08:44 +0000 (17:08 +0100)] 
Lint code in doc directory

Adjust ignore lists of linters to check more code.

(cherry picked from commit 0fb7403ef42d3a795bb21ca3c481e139491384bb)

3 months agoFix vulture warnings and tweak ignore lists
Štěpán Balážik [Wed, 28 Jan 2026 15:29:11 +0000 (16:29 +0100)] 
Fix vulture warnings and tweak ignore lists

Run vulture on the whole repository, fix most errors in previously
unchecked code, adjust ignore lists.

(cherry picked from commit 57ecaee95d84a0d9dc25ec518bd98b9c8d1b2f31)

3 months agoFix 'Too many return statements' pylint error
Štěpán Balážik [Wed, 28 Jan 2026 14:21:58 +0000 (15:21 +0100)] 
Fix 'Too many return statements' pylint error

Refactor `Key.match_properties` into multiple functions.

(cherry picked from commit 19076c0d4d39410c7060094faebccc0803312606)

3 months agoFix pylint's 'invalid-name' errors
Štěpán Balážik [Wed, 28 Jan 2026 14:12:45 +0000 (15:12 +0100)] 
Fix pylint's 'invalid-name' errors

Where possible comply with the naming rules. Add exceptions for the
function names used in KASP tests.

(cherry picked from commit 50ed74197cee16ff9df55175a251c341a191b0b3)

3 months agoMove utility Python scripts to the bind9-qa repo
Štěpán Balážik [Wed, 28 Jan 2026 12:55:53 +0000 (13:55 +0100)] 
Move utility Python scripts to the bind9-qa repo

I would have touched them anyway in this MR so let's bite the bullet
and move them there.

(cherry picked from commit a3d0f43d21f43d2dd3e179ab3871100a80a02cc4)