2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 21:17:54 +00:00

42258 Commits

Author SHA1 Message Date
Aram Sargsyan
12225d125b Test trying of the next primary server
Add test cases which check that when a XoT primary server is
unreachable or is already marked as unreachble then the next
primary server in the list is used.
2024-11-27 10:37:13 +00:00
Aram Sargsyan
3262ebd0f3 xfrin: refactor and fix the ISC_R_CANCELED case handling
Previously a ISC_R_CANCELED result code switch-case has been added to
the zone.c:zone_xfrdone() function, which did two things:

1. Schedule a new zone transfer if there's a scheduled force reload of
   the zone.

2. Reset the primaries list.

This proved to be not a well-thought change and causes problems,
because the ISC_R_CANCELED code is used not only when the whole transfer
is canceled, but also when, for example, a particular primary server is
unreachable, and named still needs to continue the transfer process by
trying the next server, which it now no longer does in some cases. To
solve this issue, three changes are made:

1. Make sure dns_zone_refresh() runs on the zone's loop, so that the
   sequential calls of dns_zone_stopxfr() and dns_zone_forcexfr()
   functions (like done in 'rndc retransfer -force') run in intended
   order and don't race with each other.

2. Since starting the new transfer is now guaranteed to run after the
   previous transfer is shut down (see the previous change), remove the
   special handling of the ISC_R_CANCELED case, and let the default
   handler to handle it like before. This will bring back the ability to
   try the next primary if the current one was interrupted with a
   ISC_R_CANCELED result code.

3. Change the xfrin.c:xfrin_shutdown() function to pass the
   ISC_R_SHUTTINGDOWN result code instead of ISC_R_CANCELED, as it makes
   more sense.
2024-11-27 10:37:13 +00:00
Aram Sargsyan
1c4a34a3ab Clean up dns_zonemgr_unreachabledel()
The results of isc_sockaddr_format() calls are not used, remove them
and the local variables.
2024-11-27 10:37:13 +00:00
Evan Hunt
f6148f66d4 chg: dev: Use default listening rules from config.c string
Remove special code which creates default listeners, and use the normal named.conf configuration parser instead. This removes unneeded code and makes the built-in configuration text provide a true primary source of defaults. This change should be transparent to end-users and should not cause any visible change.

Closes #1424

Merge branch '1424-listen-builtin-config' into 'main'

See merge request isc-projects/bind9!2663
2024-11-27 00:08:28 +00:00
Petr Menšík
c5ebe5eb0a Remove ns_listenlist_default()
It is not used anywhere in named and is no longer necessary
there.  It was called in some unit tests, but was not actually
needed by them.
2024-11-26 15:22:30 -08:00
Petr Menšík
4fa81253ea Load default listen-on[-v6] values from config.c
Stop using ns_listenlist_default() to set the default listen-on
and listen-on-v6 configuration.  Instead, configure these options
using the default values in config.c.
2024-11-26 15:22:12 -08:00
Michal Nowak
84f36f4dce chg: test: Rewrite emptyzones system test to pytest
Merge branch 'mnowak/pytest_rewrite_emptyzones' into 'main'

See merge request isc-projects/bind9!9154
2024-11-26 15:15:51 +00:00
Michal Nowak
3ace62472c Rewrite emptyzones system test to pytest 2024-11-26 15:12:12 +00:00
Michal Nowak
7bedd1c296 Add isctest.check.refused() 2024-11-26 15:12:12 +00:00
Michal Nowak
4869ebb419 chg: test: Rewrite database system test to pytest
Merge branch 'mnowak/pytest_rewrite_database' into 'main'

See merge request isc-projects/bind9!9156
2024-11-26 12:11:30 +00:00
Michal Nowak
8005ad0dcd Rewrite database system test to pytest 2024-11-26 12:10:29 +00:00
Ondřej Surý
0fa2807d2b rem: usr: Move contributed DLZ modules into a separate repository
The DLZ modules are poorly maintained as we only ensure they can still
be compiled, the DLZ interface is blocking, so anything that blocks the
query to the database blocks the whole server and they should not be
used except in testing.  The DLZ interface itself is going to be scheduled
for removal.

The DLZ modules now live in https://gitlab.isc.org/isc-projects/dlz-modules
repository.

Closes #4865

Merge branch '4865-remove-contributed-DLZ-modules' into 'main'

See merge request isc-projects/bind9!9349
2024-11-26 11:30:12 +00:00
Ondřej Surý
a6cce753e2
Move contributed DLZ modules into a separate repository
The DLZ modules are poorly maintained as we only ensure they can still
be compiled, the DLZ interface is blocking, so anything that blocks the
query to the database blocks the whole server and they should not be
used except in testing.  The DLZ interface itself should be scheduled
for removal.
2024-11-26 12:29:41 +01:00
Michal Nowak
08138d53e4 rem: test: Revert "xfail upforwd system test if DNSTAP is enabled"
This reverts commit 0579e0a4299d7d238997486c52c3e3c97ebd977d.

See isc-projects/bind9#4996

Merge branch 'mnowak/revert-xfail-upforwd-system-test' into 'main'

See merge request isc-projects/bind9!9681
2024-11-26 10:48:26 +00:00
Michal Nowak
e7e73da39a Revert "xfail upforwd system test if DNSTAP is enabled"
This reverts commit 0579e0a4299d7d238997486c52c3e3c97ebd977d.
2024-11-26 10:48:00 +00:00
Ondřej Surý
cf930c23d0 chg: usr: Add new logging module for logging crypto errors in libisc
Add a new 'crypto' log module that will be used for a low-level
cryptographic operations.  The DNS related cryptography logs
are still logged in the 'dns/crypto' module.

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

See merge request isc-projects/bind9!9287
2024-11-26 10:23:11 +00:00
Ondřej Surý
a0a1769509
Add new logging category for logging crypto errors in libisc
The libisc now includes sizeable chunks of cryptography, but the crypto
log module was missing.  Add the new ISC_LOGMODULE_CRYPTO to libisc and
use it in the isc_tls error logging.
2024-11-26 11:22:33 +01:00
Nicki Křížek
76c9522599 fix: test: Ignore test artifacts in .libs
Some tests may leave artifacts in the .libs directory. Ignore this
directory when detecting expected artifacts.

Closes #5055

Merge branch '5055-ignore-libs-artifacts' into 'main'

See merge request isc-projects/bind9!9766
2024-11-26 09:05:28 +00:00
Nicki Křížek
cf606a9ead Ignore test artifacts in .libs
Some tests may leave artifacts in the .libs directory. Ignore this
directory when detecting expected artifacts.
2024-11-26 09:05:15 +00:00
Colin Vidal
001272127f chg: usr: Add none parameter to query-source and query-source-v6 to disable IPv4 or IPv6 upstream queries
Add a none parameter to named configuration option `query-source` (respectively `query-source-v6`) which forbid usage of IPv4 (respectively IPv6) addresses when named is doing an upstream query.

Closes #4981 Turning-off upstream IPv6 queries while still listening to downstream queries on IPv6.

Merge branch 'colin/querysource-none' into 'main'

See merge request isc-projects/bind9!9727
2024-11-26 08:46:58 +00:00
Colin Vidal
bcf24ca07e Add a none parameter to query-source[-v6]
This change adds a "none" parameter to the query-source[-v6]
options in named.conf, which forbid the usage of IPv4 or IPv6
addresses when doing upstream queries.
2024-11-26 08:45:50 +01:00
Mark Andrews
b2ffa5845b chg: usr: emit more helpful log for exceeding max-records-per-type
The new log message is emitted when adding or updating an RRset
fails due to exceeding the max-records-per-type limit. The log includes
the owner name and type, corresponding zone name, and the limit value.
It will be emitted on loading a zone file, inbound zone transfer
(both AXFR and IXFR), handling a DDNS update, or updating a cache DB.
It's especially helpful in the case of zone transfer, since the
secondary side doesn't have direct access to the offending zone data.

It could also be used for max-types-per-name, but this change
doesn't implement it yet as it's much less likely to happen
in practice.

Merge branch 'helpful-log-on-toomanyrecords' into 'main'

See merge request isc-projects/bind9!9509
2024-11-26 07:15:25 +00:00
JINMEI Tatuya
000720fe14 update system tests to confirm new log messages 2024-11-26 16:39:48 +11:00
JINMEI Tatuya
b0309ee631 use more generic log module name for 'logtoomanyrecords'
DNS_LOGMODULE_RBTDB was simply inappropriate, and this
log message is actually dependent on db implementation
details, so DNS_LOGMODULE_DB would be the best choice.
2024-11-26 04:06:58 +00:00
JINMEI Tatuya
4156995431 emit more helpful log for exceeding max-records-per-type
The new log message is emitted when adding or updating an RRset
fails due to exceeding the max-records-per-type limit. The log includes
the owner name and type, corresponding zone name, and the limit value.
It will be emitted on loading a zone file, inbound zone transfer
(both AXFR and IXFR), handling a DDNS update, or updating a cache DB.
It's especially helpful in the case of zone transfer, since the
secondary side doesn't have direct access to the offending zone data.

It could also be used for max-types-per-name, but this change
doesn't implement it yet as it's much less likely to happen
in practice.
2024-11-26 04:06:58 +00:00
Mark Andrews
8e0ec3fe0a fix: usr: '{&dns}' is as valid as '{?dns}' in a SVCB's dohpath
`dig` fails to parse a valid (as far as I can tell, and accepted by `kdig` and `Wireshark`) `SVCB` record with a `dohpath` URI template containing a `{&dns}`, like `dohpath=/some/path?key=value{&dns}"`. If the URI template contains a `{?dns}` instead `dig` is happy, but my understanding of rfc9461 and section 1.2. "Levels and Expression Types" of rfc6570 is that `{&dns}` is valid.
See for example section 1.2. "Levels and Expression Types" of rfc6570.

Note that Peter van Dijk suggested that `{dns}` and `{dns,someothervar}` might be valid forms as well, so my patch might be too restrictive, although it's anyone's guess how DoH clients would handle complex templates.

Closes https://gitlab.isc.org/isc-projects/bind9/-/issues/4922

Merge branch 'svcb-dohpath-uri-template' into 'main'

See merge request isc-projects/bind9!9455
2024-11-26 03:40:57 +00:00
Mark Andrews
af54ef9f5d Parse the URI template and check for a dns variable
The 'dns' variable in dohpath can be in various forms ({?dns},
{dns}, {&dns} etc.).  To check for a valid dohpath it ends up
being simpler to just parse the URI template rather than looking
for all the various forms if substring.
2024-11-26 12:38:49 +11:00
Remi Gacogne
e74052ea71 '{&dns}' is as valid as '{?dns}' in a SVCB's dohpath
See for example section 1.2. "Levels and Expression Types" of rfc6570.
2024-11-26 12:38:33 +11:00
Mark Andrews
54889fd2af fix: usr: Provide more visibility into configuration errors
by logging SSL_CTX_use_certificate_chain_file and SSL_CTX_use_PrivateKey_file errors individually.

Closes #5008

Merge branch '5008-provide-more-visibility-into-ssl-errors' into 'main'

See merge request isc-projects/bind9!9683
2024-11-26 00:02:50 +00:00
Mark Andrews
9006839ed7 Provide more visibility into configuration errors
by logging SSL_CTX_use_certificate_chain_file and
SSL_CTX_use_PrivateKey_file errors
2024-11-26 10:31:44 +11:00
Nicki Křížek
313aec5816 fix: test: Allow re-run of mkeys system test
On some slow systems, the test might intermittently fail due to inherent
timing issues. In our CI, this most often happens in the
system:gcc:8fips:amd64 jobs.

Closes #3098

Merge branch '3098-allow-re-run-of-mkeys-test' into 'main'

See merge request isc-projects/bind9!9732
2024-11-25 14:35:17 +00:00
Nicki Křížek
a299650a6f Allow re-run of mkeys system test
On some slow systems, the test might intermittently fail due to inherent
timing issues. In our CI, this most often happens in the
system:gcc:8fips:amd64 jobs.
2024-11-25 14:56:17 +01:00
Michal Nowak
b5c080c68b fix: ci: Fix paths to binaries in cross-version-config-tests job
The cross-version-config-tests job has never functioned in CI because
the testing framework changed after the testing was completed. To run
the new "named" binary using the old configurations, paths in the test
framework must be updated to point to the location of the new binaries.

Closes #4977

Merge branch '4977-fix-cross-version-config-tests' into 'main'

See merge request isc-projects/bind9!9702
2024-11-25 12:11:02 +00:00
Michal Nowak
09d7e2430a
Fix paths to binaries in cross-version-config-tests job
The cross-version-config-tests job has never functioned in CI because
the testing framework changed after the testing was completed. To run
the new "named" binary using the old configurations, paths in the test
framework must be updated to point to the location of the new binaries.
2024-11-25 11:36:51 +01:00
Aydın Mercan
419aa3264e new: usr: add separate query counters for new protocols
Add query counters for DoT, DoH, unencrypted DoH and their proxied
counterparts. The new protocols do not update their respective TCP/UDP
transport counter and is now for TCP/UDP over plain 53 only.

Closes #598

Merge branch '598-wishlist-statistics-for-dns-over-tcp-and-tls' into 'main'

See merge request isc-projects/bind9!9585
2024-11-25 10:09:26 +00:00
Aydın Mercan
ddede2b521
document protocol query counters in arm
ARM was missing the existing QryUDP and QryTCP documentation. Add them
alongside the new protocol counters.
2024-11-25 13:07:29 +03:00
Aydın Mercan
d987e2d745
add separate query counters for new protocols
Add query counters for DoT, DoH, unencrypted DoH and their proxied
counterparts. The protocols don't increment TCP/UDP counters anymore
since they aren't the same as plain DNS-over-53.
2024-11-25 13:07:29 +03:00
Evan Hunt
44de1d5bef
wrap ns_nm_socket_type for testing
The testing ns_client doesn't have a proper nmhandle.
2024-11-25 13:07:24 +03:00
Colin Vidal
29f1d4bb6f rem: dev: Remove namedconf port/tls deprecated check on *-source[-v6] options
The usage of port and tls arguments in *-source and *-source-v6 named configuration options has been previously removed. Remove various configuration check deprecating usage of those arguments.

Merge branch 'colin/querysource-check-cleanup' into 'main'

See merge request isc-projects/bind9!9738
2024-11-22 18:34:51 +00:00
Colin Vidal
642776a976 Remove namedconf port/tls deprecated check on *-source[-v6] options
The usage of port and tls arguments in *-source and *-source-v6 named
configuration options has been previously removed. Remove
configuration check deprecating usage of those arguments.
2024-11-22 18:50:10 +01:00
Alessio Podda
a3e03b52e2 chg: dev: Incrementally apply AXFR transfer
Reintroduce logic to apply diffs when the number of pending tuples is
above 128. The previous strategy of accumulating all the tuples and
pushing them at the end leads to excessive memory consumption during
transfer.

This effectively reverts half of e3892805d6

Closes #4986

Merge branch '4986-axfr-chunked-insert' into 'main'

See merge request isc-projects/bind9!9740
2024-11-22 17:35:48 +00:00
alessio
99b4f01b33 Incrementally apply AXFR transfer
Reintroduce logic to apply diffs when the number of pending tuples is
above 128. The previous strategy of accumulating all the tuples and
pushing them at the end leads to excessive memory consumption during
transfer.

This effectively reverts half of e3892805d6
2024-11-22 15:00:55 +01:00
Alessio Podda
9f628a34cd fix: nil: Fix alpine build by removing the need for LargestIntegralType in time_test
Fix alpine build by removing the need for `LargestIntegralType` use in `tests/isc/time_test.c`.

Merge branch 'alessio/fix-time-test' into 'main'

See merge request isc-projects/bind9!9758
2024-11-22 09:25:08 +00:00
alessio
b4290a5e11 Fix alpine build by removing LargestIntegralType in time_test
Avoids using functions that require LargestIntegralType arguments in
time_test to resolve import issues on Alpine Linux. Using size_t instead
wasn't an option due to compatibility issues with 32-bit architectures.
2024-11-22 08:52:03 +01:00
Mark Andrews
2c1fb7e5eb new: usr: Enable runtime selection of FIPS mode in dig and delv
'dig -F' and 'delv -F' can now be used to select FIPS mode at runtime.

Closes #5046

Merge branch '5046-enable-runtime-selection-of-fips-mode-in-dig' into 'main'

See merge request isc-projects/bind9!9754
2024-11-22 00:12:02 +00:00
Mark Andrews
d3d88638d8 Delv now supports selecting FIPS mode at runtime
To enable FIPS mode at runtime use 'delv -F'.  The operating system
must have FIPS support available for this to succeed.  This is on
by default when built with --enable-fips-mode.
2024-11-22 09:40:46 +11:00
Mark Andrews
fe7ce99270 Dig now supports selecting FIPS mode at runtime
To enable FIPS mode at runtime use 'dig -F'.  The operating system
must have FIPS support available for this to succeed.  This is on
by default when built with --enable-fips-mode.
2024-11-22 09:40:46 +11:00
Evan Hunt
0989926745 fix: nil: Fix build of unit test on 32-bit architecture
Fix a unit test build failure on the i686 platform.

Merge branch 'bug/main/unittest-isc-time-32b' into 'main'

See merge request isc-projects/bind9!9753
2024-11-21 04:31:08 +00:00
Petr Menšík
3a8741c8a9 Fix build of unit test on 32b architecture
Fixes unittest build failure on i686 platform.

In file included from tests/isc/time_test.c:24:
tests/isc/time_test.c: In function ‘run_test_isc_time_formatISO8601TZms_test’:
tests/isc/time_test.c:284:32: error: passing argument 2 of ‘_assert_in_set’ from incompatible pointer type [-Wincompatible-pointer-types]
  284 |         assert_in_set(buf[23], plus_minus, sizeof(plus_minus));
      |                                ^~~~~~~~~~
      |                                |
      |                                size_t * {aka unsigned int *}
/usr/include/cmocka.h:2369:64: note: expected ‘const long long unsigned int *’ but argument is of type ‘size_t *’ {aka ‘unsigned int *’}
 2369 |     const LargestIntegralType value, const LargestIntegralType values[],
2024-11-21 04:23:08 +00:00
Mark Andrews
6c46ccc577 chg: nil: Re-split format strings lib/ns/update.c
Re-split format strings that had been poorly split by multiple
clang-format runs using different versions of clang-format. 

Closes #5043

Merge branch '5043-re-split-format-strings-lib-ns-update-c' into 'main'

See merge request isc-projects/bind9!9752
2024-11-21 04:21:34 +00:00