Commit graph

43824 commits

Author SHA1 Message Date
Colin Vidal
7ea70b4e19 add namedconf support for plugin inside a zone
The named.conf parser now accepts the plugin clause inside a zone
definition.  This enables us to add (in later commits) support for
zone plugins.
2025-09-09 09:42:34 +02:00
Ondřej Surý
014a05a278 rem: usr: Remove randomized RRset ordering
The rrset-order random doesn't offer uniform distribution of all
permutations and it isn't superior to cyclic order in any way.  Make the
random ordering an alias to the cyclic ordering.

Closes: #5513

Merge branch 'ondrej/remove-rrset-order-random' into 'main'

See merge request isc-projects/bind9!10912
2025-09-08 17:05:05 +02:00
Ondřej Surý
2963d1aaf1
Refactor the cyclic ordering to use query ID as offset
Mimic the Unbound behaviour where the cyclic offset is taken from query
ID, and remove recording of the current state.  As the incoming query ID
should have random distribution, the cyclic ordering should also have
uniform distribution of the starting record.
2025-09-08 14:04:13 +02:00
Ondřej Surý
b3f5c3b0fc
Refactor the cyclic ordering to be more efficient
With random ordering removed, the cyclic ordering can be rewritten in a
that it uses thread_local static array to keep the cyclic order.

This could be further improved by keeping the current position inside
the slabheader and adding a function to start directly there instead at
dns_rdataset_first().
2025-09-08 14:04:13 +02:00
Ondřej Surý
7dc6048f93
Remove the random ordering of resource records in RRset
The rrset-order random doesn't offer uniform distribution of all
permutations and it isn't superior to cyclic order in any way.  Make the
random ordering an alias to the cyclic ordering.
2025-09-08 14:04:13 +02:00
Colin Vidal
b449fa9500 new: usr: add extra tokens to the zone file name template
Extend the `$name`, `$view` and `$type` tokens (expanding into the zone
name, zone's view name and type); the new following tokens are now also
accepted:

- `$name` or `%s` is replaced with the zone name in lower case;
- `$type` or `%t` is replaced with the zone type -- i.e., primary,
  secondary, etc);
- `$view` or `%v` is replaced with the view name;
- `$char1` or `%1` is replaced with the first character of the zone name;
- `$char2` or `%2` is replaced with the second character of the zone name
  (or a dot if there is no second character);
- `$char3` or `%3` is replaced with the third character of the zone name (or
  a dot if there is no third character);
- `$label1` or `%z` is replaced with the toplevel domain of the zone (or a
  dot if it is the root zone);
- `$label2` or `%y` is replaced with the next label under the toplevel
  domain (or a dot if there is no next label);
- `$label3` or `%x` is replaced with the next-next label under the toplevel
  domain (or a dot if there is no next-next label).

Closes #85

Merge branch '85-file-template' into 'main'

See merge request isc-projects/bind9!10779
2025-09-08 12:46:48 +02:00
Colin Vidal
0e1f13e05c add extra tokens to the zone file name template
Extend the `$name`, `$view` and `$type` tokens (expanding into the zone
name, zone's view name and type); the new following tokens are now also
accepted:

- $name or %s is replaced with the zone name in lower case;
- $type or %t is replaced with the zone type -- i.e., primary,
  secondary, etc);
- $view or %v is replaced with the view name;
- $char1 or %1 is replaced with the first character of the zone name;
- $char2 or %2 is replaced with the second character of the zone name
  (or a dot if there is no second character);
- $char3 or %3 is replaced with the third character of the zone name (or
  a dot if there is no third character);
- $label1 or %z is replaced with the toplevel domain of the zone (or a
  dot if it is the root zone);
- $label2 or %y is replaced with the next label under the toplevel
  domain (or a dot if there is no next label);
- $label3 or %x is replaced with the next-next label under the toplevel
  domain (or a dot if there is no next-next label).
2025-09-08 12:10:09 +02:00
Petr Špaček
c0d12c1328 chg: doc: Set up version for BIND 9.21.13
Merge branch 'andoni/set-up-version-for-bind-9.21.13' into 'main'

See merge request isc-projects/bind9!10952
2025-09-08 09:45:16 +00:00
Andoni Duarte Pintado
c6d0278a4b Update BIND version to 9.21.13-dev 2025-09-08 11:41:27 +02:00
Ondřej Surý
15672f3eaa fix: nil: Replace .reuse/dep5 with REUSE.toml
Update to REUSE Specification 3.2+ that uses REUSE.toml instead of DEP5
based specification.

Merge branch 'ondrej/cover-reuse-dep5-to-toml' into 'main'

See merge request isc-projects/bind9!10945
2025-09-08 11:22:51 +02:00
Ondřej Surý
5d03261448
Replace .reuse/dep5 with REUSE.toml
Update to REUSE Specification 3.2+ that uses REUSE.toml instead of DEP5
based specification.
2025-09-06 15:58:22 +02:00
Petr Špaček
3e8d31b47b chg: doc: Document rndc dnssec -step
Related to #4606

Merge branch '4606-document-rndc-dnssec-step' into 'main'

See merge request isc-projects/bind9!10941
2025-09-04 13:49:56 +00:00
Matthijs Mekking
b1a9ce7104 Document rndc dnssec -step
This documentation was missing from !10774.
2025-09-04 15:41:43 +02:00
Petr Špaček
d8b975735a fix: dev: RPZ 'servfail-until-ready': skip updating SERVFAIL cache
In order to not pollute the SERVFAIL cache with the configured
SERVFAIL answers while RPZ is loading, set the NS_CLIENTATTR_NOSETFC
attribute for the client.

Merge branch 'aram/rpz-servfail-until-ready-tunings' into 'main'

See merge request isc-projects/bind9!10904
2025-09-03 13:23:38 +00:00
Aram Sargsyan
1962857ac4 Log the servfail-until-ready message not faster than once per second
Since the log level has been raised, busy servers can "explode" from
the amount of log messages. Use the usual practice of logging "every
once in a while".
2025-09-03 13:23:12 +00:00
Aram Sargsyan
49356ce944 Change the "RPZ not ready yet" message and its log level
The "RPZ not ready yet" message is logged at debug 3 level. Use the
info level instead for better visibility.

After raising the log level, the rpz_log_fail_helper() function starts
appending " failed: " the the message. Change the log message so it
makes more sense.
2025-09-03 13:23:12 +00:00
Aram Sargsyan
d9b5f6c502 RPZ 'servfail-until-ready': skip updating SERVFAIL cache
In order to not pollute the SERVFAIL cache with the configured
SERVFAIL answers while RPZ is loading, set the NS_CLIENTATTR_NOSETFC
attribute for the client.
2025-09-03 13:23:12 +00:00
Ondřej Surý
46c88265da chg: doc: Clarify rrset-order random distribution
The randomized order of the records in the rrset is not uniform across
all permutations.  Clarify this in the documentation.

Closes #5485

Merge branch 'ondrej/clarify-rrset-order-random' into 'main'

See merge request isc-projects/bind9!10909
2025-09-03 08:50:50 +02:00
Ondřej Surý
369c8dc388 Clarify rrset-order random distribution
The randomized order of the records in the rrset is not uniform across
all permutations.  Clarify this in the documentation.
2025-09-03 08:50:40 +02:00
Mark Andrews
bdcb90f43c new: usr: Support for parsing HHIT and BRID records has been added
Closes #5444

Merge branch '5444-add-hhit-and-brid-records' into 'main'

See merge request isc-projects/bind9!10795
2025-09-03 10:47:37 +10:00
Mark Andrews
92621e6390 Add tests for BRID and HHIT 2025-09-03 10:05:13 +10:00
Mark Andrews
6b29da55fc Add support for parsing and displaying BRID rdata type 2025-09-03 10:05:13 +10:00
Mark Andrews
37041c3ec3 Add support for parsing and displaying HHIT rdata type 2025-09-03 10:05:13 +10:00
Mark Andrews
70757a47e6 fix: usr: RPZ canonical warning displays zone entry incorrectly
When an IPv6 rpz prefix entry is entered incorrectly the log
message was just displaying the prefix rather than the full
entry.  This has been corrected.

Closes #5491

Merge branch '5491-rpz-canonical-warning-displays-zone-entry-incorrectly' into 'main'

See merge request isc-projects/bind9!10890
2025-09-03 09:41:18 +10:00
Mark Andrews
76db9e276f Add non canonical form entry to trigger log message 2025-09-03 09:01:54 +10:00
Mark Andrews
283da99f02 RPZ canonical warning displays zone entry incorrectly
Do not insert a NUL into ip_str too early as the full value
is needed later.  Only insert the NUL immediately before
displaying just the prefix string.
2025-09-03 09:01:54 +10:00
Ondřej Surý
b0d3a36a0a rem: nil: Remove qname/qtype from dns_adb_createfind() call
Both qname and qtype arguments to dns_adb_createfind() were unused.
Remove both these arguments from the function prototype.

Merge branch 'ondrej/minor-dns_adb-cleanup' into 'main'

See merge request isc-projects/bind9!10918
2025-09-02 21:41:05 +02:00
Ondřej Surý
5b025d6e43
Remove qname/qtype from dns_adb_createfind() call
Both qname and qtype arguments to dns_adb_createfind() were unused.
Remove both these arguments from the function prototype.
2025-09-02 20:16:58 +02:00
Matthijs Mekking
085653d8b7 chg: test: Wait for rekey_done log in rollover system tests
Waiting for "keymgr: done" logs caused some manual-mode tests to fail intermittently. Waiting for "rekey done" logs should be more reliable.

Closes #5493

Merge branch '5493-algoroll-csk-step3-manual-unstable-test' into 'main'

See merge request isc-projects/bind9!10923
2025-09-02 13:03:08 +00:00
Matthijs Mekking
4141ae1275 Wait for rekey_done log in rollover system tests
Waiting for "keymgr: done" logs caused some manual-mode tests to fail
intermittently. Waiting for "rekey done" logs should be more reliable.
2025-09-02 14:28:48 +02:00
Alessio Podda
8e3e4a5c19 chg: dev: Lazily allocate fetch counter
The counter in ns_client_t is used to track the maximum number of
recursions in the resolver, but it is created unconditionally when
starting the client and deallocated when resetting it.

This commit defers the allocation of the counter till recursion needs to
actually happen, speeding up authoritative workloads in perflab by
1.5~2%.

Merge branch 'alessio/lazy-fetch-counter-alloc' into 'main'

See merge request isc-projects/bind9!10917
2025-09-02 09:57:30 +00:00
Alessio Podda
20a1583661 Lazily allocate fetch counter
The counter in ns_client_t is used to track the maximum number of
recursions in the resolver, but it is created unconditionally when
starting the client and deallocated when resetting it.

This commit defers the allocation of the counter till recursion needs to
actually happen, speeding up authoritative workloads in perflab by
1.5~2%.
2025-09-02 11:22:28 +02:00
Andoni Duarte
3762bf7fed new: test: Test another 'stale-answer-client-timeout 0' scenario
Add a test to check serve-stale with the 'stale-answer-client-timeout 0'
configuration option and with a delegation which is a CNAME to a auth
zone.

Closes #5372

Merge branch '5372-serve-stale-crash-on-insist-unreachable-test' into 'main'

See merge request isc-projects/bind9!10920
2025-09-02 08:50:18 +00:00
Aram Sargsyan
04ed44e7d7 Test another 'stale-answer-client-timeout 0' scenario
Add a test to check serve-stale with the 'stale-answer-client-timeout 0'
configuration option and with a delegation which is a CNAME to a auth
zone.
2025-09-02 08:07:15 +00:00
Michał Kępień
bed752f57f rem: usr: Obsolete the "tkey-domain" statement
Mark the ``tkey-domain`` statement as obsolete, since it has not had any
effect on server behavior since support for TKEY Mode 2 (Diffie-Hellman)
was removed (in BIND 9.20.0).

See #4204

Merge branch '4204-obsolete-tkey-domain' into 'main'

See merge request isc-projects/bind9!10798
2025-09-01 22:29:23 +02:00
Michał Kępień
805f1c0f65
Obsolete the "tkey-domain" statement
The "tkey-domain" statement has effectively been a no-op since commit
bd4576b3ce, which removed the only bit of
code using it: the logic implementing TKEY Mode 2 (Diffie-Hellman).

A subsequent cleanup commit, 885c132f4a,
also missed the opportunity to remove the "tkey-domain" statement
altogether.

Mark the "tkey-domain" statement as obsolete and remove all code and
documentation related to it.
2025-09-01 21:35:33 +02:00
Michał Kępień
c47e8edd09 rem: usr: Deprecate the "tkey-gssapi-credential" statement
The :any:`tkey-gssapi-keytab` statement allows GSS-TSIG to be set up in
a simpler and more reliable way than using the
:any:`tkey-gssapi-credential` statement and setting environment
variables (e.g. ``KRB5_KTNAME``). Therefore, the
:any:`tkey-gssapi-credential` statement has been deprecated;
:any:`tkey-gssapi-keytab` should be used instead.

For configurations currently using a combination of both
:any:`tkey-gssapi-keytab` *and* :any:`tkey-gssapi-credential`, the
latter should be dropped and the keytab pointed to by
:any:`tkey-gssapi-keytab` should now only contain the credential
previously specified by :any:`tkey-gssapi-credential`.

See #4204

Merge branch '4204-deprecate-tkey-gssapi-credential' into 'main'

See merge request isc-projects/bind9!10782
2025-09-01 21:33:33 +02:00
Michał Kępień
6de435c528
Deprecate the "tkey-gssapi-credential" statement
The "tkey-gssapi-keytab" statement enables GSS-TSIG to be set up in a
simpler and more reliable way than using the "tkey-gssapi-credential"
statement and setting environment variables (e.g. KRB5_KTNAME).

Mark the "tkey-gssapi-credential" statement as deprecated to eventually
only have one method for setting up GSS-TSIG in named.  Do not mention
"tkey-gssapi-credential" in the section of the ARM on dynamic updates.
2025-09-01 21:23:30 +02:00
Michal Nowak
3c0c66dc3e new: ci: Add Debian "trixie"
Merge branch 'mnowak/add-debian-trixie' into 'main'

See merge request isc-projects/bind9!10827
2025-09-01 17:05:34 +02:00
Michal Nowak
62ed25d7c0
Drop unused env variable SCANBUILD 2025-09-01 16:28:33 +02:00
Michal Nowak
2b793d3f14
scan-build does not need to wait for previous stages 2025-09-01 16:28:33 +02:00
Michal Nowak
bb26409f34
Make "trixie" the base image 2025-09-01 16:28:33 +02:00
Michal Nowak
840069856f
Move CI and QA tools from Debian "sid" to "trixie"
Debian "sid" is not a stable test bed and should be avoided.
2025-09-01 16:28:33 +02:00
Michal Nowak
263810e779
Add Debian "trixie" 2025-09-01 16:28:33 +02:00
Ondřej Surý
d468180fbe chg: nil: Refactoring in the qpcache and qpzone
- Remove double non-NULL guard around bindrdataset()
- Add DNS_SLABTOP_FOREACH macros
- Made add() function in qpcache a single pass

Merge branch 'ondrej/add-DNS_SLABTOP_FOREACH' into 'main'

See merge request isc-projects/bind9!10879
2025-08-28 20:11:14 +02:00
Ondřej Surý
8dd99876b8
Always scan all the slab headers when adding new entry
The existing logic would always scan the headers if:
- adding negative cache entry that's NXDOMAIN or negative RRSIG
- adding positive cache entry
- the type doesn't exist in the node

As the rest is relatively minor - we only delete rrset from resolver
on broken chain and most negative entries don't exist in the case
anyway, it feels like the extra logic to decide whether we should do
full scan or not is just complicating things.

Remove the extra logic and always scan all the slabtop/slabheaders in
the node when adding new entry into the cache.
2025-08-28 19:28:56 +02:00
Ondřej Surý
37fa960bd5
Add few missing qpcache_hit() calls
There were couple of missing qpcache_hit() calls in qpcache.c:add()
function where existing data was better than the newly added header.
2025-08-28 19:28:56 +02:00
Ondřej Surý
7b7901494d
Refactoring in qpcache.c:add()
There were several consequtive foreach loops when adding new entry into
the cache.  Merge the multiple foreach loops into a single pass loop
with some effort and a lot of comments.
2025-08-28 19:28:55 +02:00
Ondřej Surý
e3c0a2a0fd
Add DNS_SLABTOP_FOREACH macros
Add foreach macros to iterate through the dns_slabtop_t
single-linked lists.
2025-08-28 19:28:55 +02:00
Ondřej Surý
c60bdbcf5c
Remove double non-NULL guard around bindrdataset()
The bindrdataset() already has a logic to skip the rest of the function
if the passed rdataset is NULL.  Remove the external guarding for
'addedrdataset' to simplify the code flow both from the zone and cache
databases.
2025-08-28 19:28:55 +02:00