Commit graph

43803 commits

Author SHA1 Message Date
Mark Andrews
f5acdbb783 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 cfa21d1e8b)
2026-03-12 09:26:01 +00:00
Mark Andrews
4ed9da5b05 [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
2026-03-12 13:10:28 +11:00
Ondřej Surý
22aa753e8c Expand blackhole description
Clarify the behavior of negated addresses within the `blackhole`
statement to prevent common configuration misunderstandings.

(cherry picked from commit 2b23c7011e)
2026-03-12 01:09:03 +00:00
Michal Nowak
2439e306a5 [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
2026-03-10 16:13:34 +01:00
Michal Nowak
005aa31fd8 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 77a7430a5f)
2026-03-10 13:25:05 +00:00
Nicki Křížek
b74c440a0d [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
2026-03-09 18:02:50 +01:00
Nicki Křížek
9b05158872 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 f2f255d67e)
2026-03-09 15:48:57 +00:00
Nicki Křížek
431a04ce28 [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
2026-03-09 15:54:39 +01:00
Nicki Křížek
1f6b58fa60 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 a22e03f71b)
2026-03-09 12:12:41 +00:00
Andoni Duarte
bdc211aabe [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
2026-03-06 09:28:35 +00:00
Andoni Duarte Pintado
8a404e8acd 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 0ad724558e)
2026-03-06 09:25:00 +00:00
Michal Nowak
1714ce4a65 [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
2026-03-04 12:56:17 +01:00
Michal Nowak
7795fa70dc
Ignore clang-format-22 reformatting commits
(cherry picked from commit 01d16e049e)
2026-03-04 12:18:44 +01:00
Michal Nowak
82991c7881
Use clang-format-22 to update formatting
(cherry picked from commit 239464f276)
2026-03-04 12:18:27 +01:00
Michal Nowak
257cb68e5b
Add LLVM 22
(cherry picked from commit ffd7636e79)
2026-03-04 12:14:04 +01:00
Štěpán Balážik
8d557b0e9d [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
2026-03-03 08:03:40 +00:00
Štěpán Balážik
36c56f0d90 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 a719341314)
2026-03-03 07:58:04 +01:00
Colin Vidal
819fe45274 [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
2026-03-01 20:01:20 +01:00
Colin Vidal
6d75e03971 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 d8f46b09a7)
2026-03-01 13:41:53 +01:00
Colin Vidal
867a85713e 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 b90399ebdc)
2026-03-01 13:41:53 +01:00
Michał Kępień
c460ce8430 Merge tag 'v9.20.20' into bind-9.20 2026-02-27 12:20:20 +00:00
Michał Kępień
70865706d2
Update BIND version for release 2026-02-26 21:53:41 +01:00
Michał Kępień
1ee5b847e5 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
2026-02-26 21:50:29 +01:00
Michał Kępień
09dd097c0d
Add release note for GL !11565 2026-02-26 21:29:38 +01:00
Michał Kępień
576285226f
Reorder release notes 2026-02-26 21:29:38 +01:00
Michał Kępień
b1e994ef9b
Tweak and reword release notes 2026-02-26 21:29:38 +01:00
Michał Kępień
140d817e13
Prepare release notes for BIND 9.20.20 2026-02-26 21:29:38 +01:00
Michał Kępień
833316c29f
Generate changelog for BIND 9.20.20 2026-02-26 21:29:38 +01:00
Michał Kępień
41c963685d 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
2026-02-26 12:02:32 +01:00
Michał Kępień
0241c8883a
Update BIND version to 9.20.21-dev 2026-02-26 12:00:26 +01:00
Ondřej Surý
dd453590a0 [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
2026-02-26 09:13:34 +01:00
Colin Vidal
d85889710b
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 5274e764c4)
2026-02-26 08:17:23 +01:00
Ondřej Surý
8ddab7f0b8
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 3c33e7d937)
2026-02-26 08:17:23 +01:00
Matthijs Mekking
9901ca97a4 [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
2026-02-25 17:05:26 +00:00
Matthijs Mekking
038a9ae46a 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 5bd6322739)
2026-02-25 16:27:29 +00:00
Štěpán Balážik
6ff1e897b0 [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
2026-02-25 16:01:00 +00:00
Štěpán Balážik
9cbd49827b 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 4ed6c4e4e7)
2026-02-25 16:09:32 +01:00
Štěpán Balážik
191026a4cc [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
2026-02-25 13:49:25 +00:00
Štěpán Balážik
23c3da1dc8 Add ruff job to CI
Run the linter on Python code changes in CI.

(cherry picked from commit 8b0a8dbd8e)
2026-02-25 13:33:53 +01:00
Štěpán Balážik
6e91738efe 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 ced002c4ab)
2026-02-25 13:33:46 +01:00
Štěpán Balážik
c04b9251aa 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 d3186c7038)
2026-02-25 13:33:25 +01:00
Štěpán Balážik
963ef9cb8e 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 1d5924c82f)
2026-02-25 13:33:25 +01:00
Štěpán Balážik
17cf986396 Replace Optional[T] with T | None
Generated with: ruff check --extend-select UP045 --fix && black .

(cherry picked from commit fe38515ad0)
2026-02-25 13:33:25 +01:00
Štěpán Balážik
89ce3b5e74 Remove the rest of Union usages by hand
These require some manual changes.

(cherry picked from commit cdb7428431)
2026-02-25 13:33:25 +01:00
Štěpán Balážik
95f49d58b9 Replace Union[S, T] with S | T
Generated with: ruff check --extend-select UP007 --fix && black .

(cherry picked from commit ce9c9a1a9c)
2026-02-25 13:33:25 +01:00
Štěpán Balážik
a7ef013f6d Built-in types are now subscriptable
Generated with: ruff check --extend-select UP006 --fix

(cherry picked from commit 790745da18)
2026-02-25 13:33:25 +01:00
Štěpán Balážik
5fc2b9b2f3 Remove superfluous 'pylint: disable' directives
Some of these have been fixed already, fix the rest.

(cherry picked from commit 08f5e5ebd1)
2026-02-25 13:33:25 +01:00
Štěpán Balážik
e5d5a6433c Remove unused imports
Generated with: ruff check --extend-select F401 --fix

(cherry picked from commit b00f16f026)
2026-02-25 13:33:25 +01:00
Štěpán Balážik
af85bc2592 Set pytestmark explicitly in rollover* and nsec3* tests
Importing pytestmark confuses static analysis tools as they flag it as
unused.

(cherry picked from commit 7178c97e5c)
2026-02-25 13:33:25 +01:00
Štěpán Balážik
99658ad4a1 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 ef21b77912)
2026-02-25 13:33:25 +01:00