2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

43778 Commits

Author SHA1 Message Date
Evan Hunt
a37afc3bb1 fix: usr: Use IPv6 queries in delv +ns
`delv +ns` invokes the same code to perform name resolution as `named`,
but it neglected to set up an IPv6 dispatch object first. Consequently,
it was behaving more like `named -4`. It now sets up dispatch objects
for both address families, and performs resolver queries to both v4 and v6
addresses, except when one of the address families has been suppressed
by using `delv -4` or `delv -6`.

Closes #5352

Merge branch '5352-delv-ipv6' into 'main'

See merge request isc-projects/bind9!10563
2025-06-13 03:12:18 +00:00
Evan Hunt
d29f1d1710 add tests for 'delv +ns -4' and '-6'
check that `delv +ns` sends iterative queries over both address
families when -4 and -6 are not used, and suppresses queries
appropriately when they are.
2025-06-12 19:44:21 -07:00
Evan Hunt
70ce3136bd Use ipv6 queries in delv +ns
`delv +ns` invokes the same code to perform name resolution as `named`,
but it neglected to set up an IPv6 dispatch object first. Consequently,
it was behaving more like `named -4`.

It now sets up dispatch objects for both address families, and performs
resolver queries to both v4 and v6 addresses, except when one of the
address families has been suppressed by using `delv -4` or `delv -6`.
2025-06-12 19:44:21 -07:00
Evan Hunt
9e34528393 fix: dev: Remove zone keyopts field
The "keyopts" field of the dns_zone object was added to support
"auto-dnssec"; at that time the "options" field already had most of
its 32 bits in use by other flags, so it made sense to add a new
field.

Since then, "options" has been widened to 64 bits, and "auto-dnssec"
has been obsoleted and removed. Most of the DNS_ZONEKEY flags are no
longer needed. The one that still seems useful (_FULLSIGN) has been
moved into DNS_ZONEOPT and the rest have been removed, along with
"keyopts" and its setter/getter functions.

Merge branch 'each-cleanup-zonekey-opts' into 'main'

See merge request isc-projects/bind9!10564
2025-06-13 02:43:30 +00:00
Evan Hunt
d586c29069 Remove zone keyopts field
The "keyopts" field of the dns_zone object was added to support
"auto-dnssec"; at that time the "options" field already had most of
its 32 bits in use by other flags, so it made sense to add a new
field.

Since then, "options" has been widened to 64 bits, and "auto-dnssec"
has been obsoleted and removed. Most of the DNS_ZONEKEY flags are no
longer needed. The one that still seems useful (_FULLSIGN) has been
moved into DNS_ZONEOPT and the rest have been removed, along with
"keyopts" and its setter/getter functions.
2025-06-12 18:29:29 -07:00
Evan Hunt
b1a8938d1a fix: dev: Clean up CFG_ZONE_DELEGATION
`type delegation-only` has been obsolete for some time
(see #3953) but the zone type flag for it was still defined
in libisccfg. It has now been removed.

Merge branch 'each-cleanup-delegation' into 'main'

See merge request isc-projects/bind9!10558
2025-06-13 01:28:42 +00:00
Evan Hunt
1a24dfcddf Clean up CFG_ZONE_DELEGATION
"type delegation-only" has been obsolete for some time
(see #3953) but the zone type flag for it was still defined
in libisccfg. It has now been removed.
2025-06-12 17:46:14 -07:00
Aydın Mercan
0c7a54095f new: dev: replace the build system with meson
This MR replaces the build system with meson.

Speed: Meson is noticeably faster to setup and build than automake/autoconf.
The improvements will likely add up in CI and development over time.

Readability: Readability is a subjective criteria but meson is generally regarded as easier to read compared to CMake and automake/autoconf.

Developer Ergonomics: Meson produces a compilation database, doesn't require libtool wrapping of executables/debuggers and offers JSON based build introspection.

WrapDB and downloading dependencies is a non-issue for us since it requires writing wrap files explicitly and has been disabled by default via the `wrap_mode=nofallback` project option as a measure.

Merge branch 'aydin/meson-experiment' into 'main'

See merge request isc-projects/bind9!8989
2025-06-11 08:01:15 +00:00
Aydın Mercan
5cd6c173ff
replace the build system with meson
Meson is a modern build system that has seen a rise in adoption and some
version of it is available in almost every platform supported.

Compared to automake, meson has the following advantages:

* Meson provides a significant boost to the build and configuration time
  by better exploiting parallelism.

* Meson is subjectively considered to be better in readability.

These merits alone justify experimenting with meson as a way of
improving development time and ergonomics. However, there are some
compromises to ensure the transition goes relatively smooth:

* The system tests currently rely on various files within the source
  directory. Changing this requirement is a non-trivial task that can't
  be currently justified. Currently the last compiled build directory
  writes into the source tree which is in turn used by pytest.

* The minimum version supported has been fixed at 0.61. Increasing this
  value will require choosing a baseline of distributions that can
  package with meson. On the contrary, there will likely be an attempt
  to decrease this value to ensure almost universal support for building
  BIND 9 with meson.
2025-06-11 10:30:12 +03:00
Michal Nowak
24026bae48 chg: doc: Set up version for BIND 9.21.10
Merge branch 'mnowak/set-up-version-for-bind-9.21.10' into 'main'

See merge request isc-projects/bind9!10567
2025-06-11 07:23:17 +00:00
Michal Nowak
50cc787d06 Update BIND version to 9.21.10-dev 2025-06-11 09:05:07 +02:00
Michal Nowak
514753e09f
Update BIND version for release v9.21.9 2025-06-06 10:57:23 +02:00
Michal Nowak
467dfd6fad new: doc: Prepare documentation for BIND 9.21.9
Merge branch 'mnowak/prepare-documentation-for-bind-9.21.9' into 'v9.21.9-release'

See merge request isc-private/bind9!805
2025-06-06 08:53:23 +00:00
Michal Nowak
62d04402c9
Tweak and reword release notes 2025-06-06 10:38:08 +02:00
Michal Nowak
c5840384cb
Prepare release notes for BIND 9.21.9 2025-06-05 12:01:37 +02:00
Michal Nowak
26f3f74c6c
Generate changelog for BIND 9.21.9 2025-06-05 11:58:49 +02:00
Ondřej Surý
59585e2294 fix: dev: Try to skip lock on fully lower names
If the name is fully lowercase, we don't need to access the case bitmap in order to set the case. Therefore, we can check for the FULLYLOWERCASE flag using only atomic operations, and skip a lock in the hot path, provided we clear the FULLYLOWERCASE flag before changing the case bitmap.

Merge branch 'alessio/skip-lock-on-fully-lower-names' into 'main'

See merge request isc-projects/bind9!10497
2025-06-04 10:48:18 +00:00
Alessio Podda
4a6d7eb4f3 Try to skip lock on fully lower names
If the name is fully lowercase, we don't need to access the case bitmap
in order to set the case. Therefore, we can check for the FULLYLOWERCASE
flag using only atomic operations, and skip a lock in the hot path,
provided we clear the FULLYLOWERCASE flag before changing the case
bitmap.
2025-06-04 10:48:08 +00:00
Arаm Sаrgsyаn
b814434836 new: usr: Redesign the unreachable primaries cache
Previously, the cache for the unreachable primary servers was limited
to 10 entries (LRU) and a fixed 10 minutes delay for each entry, unless
removed forcibly by a new entry. The cache is now redesigned to remove the
10 entry limitation and to introduce delay values with exponential
backoff time - initially an unreachable primary server is cached as
being unreachable for 10 seconds, but each time the cache entry is expired
and the same server is added again during the eligibility period of the next
120 seconds, the delay time is doubled up until to the maximum of 640
seconds.

Closes #3992

Merge branch '3992-unreachable-cache-redesign' into 'main'

See merge request isc-projects/bind9!10393
2025-06-04 10:22:38 +00:00
Aram Sargsyan
0f2fba46ad Document the new unreachable cache behavior
Update the documentaion to include information about how the cache's
exponential backoff works, and how to clear the cache.
2025-06-04 09:16:35 +00:00
Aram Sargsyan
14915b0241 Redesign the unreachable primaries cache
The cache for unreachable primaries was added to BIND 9 in 2006 via
1372e172d0e0b08996376b782a9041d1e3542489. It features a 10-slot LRU
array with 600 seconds (10 minutes) fixed delay. During this time, any
primary with a hiccup would be blocked for the whole block duration
(unless overwritten by a different entry).

As this design is not very flexible (i.e. the fixed delay and the fixed
amount of the slots), redesign it based on the badcache.c module, which
was implemented earlier for a similar mechanism.

The differences between the new code and the badcache module were large
enough to create a new module instead of trying to make the badcache
module universal, which could complicate the implementation.

The new design implements an exponential backoff for entries which are
added again soon after expiring, i.e. the next expiration happens in
double the amount of time of the previous expiration, but in no more
time than the defined maximum value.

The initial and the maximum expiration values are hard-coded, but, if
required, it should be trivial to implement configurable knobs.
2025-06-04 09:16:35 +00:00
Colin Vidal
bb1458460b fix: dev: initialize queryonacl dns_view_t property
A dns_view_t has a queryonacl property, which is supposed to hold the
ACL matching the configuration "allow-query-on". However the code
parsing this configuration ACL was missing (or removed by mistake?),
hence this property was always NULL. The ACL was still built but
individually for each zone (which checks if the property exists in the
zone definition, view definition, and finally options definition).

We now create the ACL instance at the view level, enabling zones to
share the same (identical) ACL instead of having their own copies.

Merge branch 'colin/view-allowqueryon' into 'main'

See merge request isc-projects/bind9!10551
2025-06-04 08:24:18 +00:00
Colin Vidal
48dc763949 initialize queryonacl dns_view_t property
A dns_view_t has a queryonacl property, which is supposed to hold the
ACL matching the configuration "allow-query-on". However the code
parsing this configuration ACL was missing (or removed by mistake?),
hence this property was always NULL. The ACL was still built but
individually for each zone (which checks if the property exists in the
zone definition, view definition, and finally options definition).

It now create the ACL instance at the view level, enabling zones to
share the same (identical) ACL instead of having their own copies.
2025-06-04 08:55:23 +02:00
Evan Hunt
93c44ba551 new: usr: Add support for zone templates
To simplify the configuration of multiple similar zones, BIND now supports a zone template mechanism. `template` blocks containing zone options can be defined at the top level of the configuration file; they can then be referenced in `zone` statements. A zone referencing a template will use the options in the specified `template` block as defaults. (Options locally defined in the `zone` statement override the template.)

The filename for a zone can now be generated parametrically from a format specified in the `file` option. The first occurrences of `$name`, `$type` and `$view` in `file` are replaced with the zone origin, the zone type (i.e., primary, secondary, etc), and the view name, respectively.

Primary zones can now take an `initial-file` option, specifying the path to a generic zone file that will be copied into the zone's `file` path when the zone is first loaded, if the `file` does not already exist.

For example, the following template can be used for primary zones:
```
        template primary {
                type primary;
                file "$name.db";
                initial-file "generic.db";
        };
```

With this template in place, a new primary zone could be added using a single `rndc addzone` command:

```
        $ rndc addzone example.com '{ template primary; };'
```

The zone would be created using the filename `example.com.db`, which would be copied into place from `generic.db`.

Closes #2964

Merge branch '2964-zone-templates' into 'main'

See merge request isc-projects/bind9!10407
2025-06-03 19:45:06 +00:00
Evan Hunt
b8f325ae01 Add support for zone templates
A "template" statement can contain the same configuration clauses
as a "zone" statement.  A "zone" statement can now reference a
template, and all the clauses in that template will be used as
default values for the zone. For example:

    template primary {
        type primary;
        file "$name.db";
        initial-file "primary.db";
    };

    zone example.com {
        template primary;
        file "different-name.db"; // overrides the template
    };
2025-06-03 12:03:07 -07:00
Evan Hunt
598ae3f63c Allow zone names to be generated parametrically
Special tokens can now be specified in a zone "file" option
in order to generate the filename parametrically. The first
instead of "$name" in the "file" option is replaced with the
zone origin, the first instance of "$type" is replaced with the
zone type (i.e., primary, secondary, etc), and the first instance
of "$view" is replaced with the view name..

This simplifies the creation of zones using initial-file templates.
For example:

   $ rndc addzone <zonename> \
     { type primary; file "$name.db"; initial-file "template.db"
2025-06-03 12:03:07 -07:00
Evan Hunt
60b129da25 Add zone "initial-file" option
When loading a primary zone for the first time, if the zonefile
does not exist but an "initial-file" option has been set, then a
new file will be copied into place from the path specified by
"initial-file".

This can be used to simplify the process of adding new zones. For
instance, a template zonefile could be used by running:

    $ rndc addzone example.com \
        '{ type primary; file "example.db"; initial-file "template.db"; };'
2025-06-03 12:03:07 -07:00
Evan Hunt
2ad9516a72 fix: dev: Call zone syntax checks when running rndc addzone/modzone
The function that checks zone syntax in libisccfg was previously
only called when loading `named.conf`, not when parsing an an
`rndc addzone` or `rndc modzone` command. This has been corrected.

Closes #5338

Merge branch '5338-check-zoneconf' into 'main'

See merge request isc-projects/bind9!10520
2025-06-03 19:01:19 +00:00
Evan Hunt
0b8f943a6a normalize syntax checks between named and libisccfg
there were some duplicated syntax checks in named_zone_configure()
that are no longer needed, now that we perform those same checks
using isccfg_check_zoneconf().

there were also some syntax checks that were *only* in
named_zone_configure(), which have now been moved to
isccfg_check_zoneconf(). test cases for them have been
added to the checkconf system test.
2025-06-03 11:15:54 -07:00
Evan Hunt
2d57c1e737 call zone syntax checks when running rndc addzone/modzone
the function that checks zone syntax in libisccfg was previously
only called when loading named.conf, not when parsing an an
"rndc addzone" or "rndc modzone" command. this has been corrected.

note that some checks are still skipped: those that check for
duplication of filenames, key directories, etc.  to fix this, we'd need
to export the symbol tables that are set up when loading named.conf and
preserve them so they could be reused later.
2025-06-03 11:15:40 -07:00
Ondřej Surý
bf6caadd67 fix: dev: Fix builds for the OSS-Fuzz project
Add the `size` argument to the fuzzing version of the `chunk_get_raw()` function.

Merge branch '5353-fix-ossfuzz-build' into 'main'

See merge request isc-projects/bind9!10553
2025-06-03 18:03:51 +00:00
Miltos Allamanis
c04b840260
Fix builds for the OSS-Fuzz project
Since 70b1777d8aef75da1b184fe8155dc818ce66628a was commited the OSS-Fuzz
build was broken because the `chunk_get_raw()` was not updated in the
`FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION`-enabled area.  Add the `size`
argument to the fuzzing version of the `chunk_get_raw()` function.
2025-06-03 18:41:45 +02:00
Evan Hunt
7d1cf8f055 fix: test: Prevent .hypothesis artifacts in system test directories
Merge branch 'each-hypothesis-artifacts' into 'main'

See merge request isc-projects/bind9!10518
2025-06-03 07:35:38 +00:00
Evan Hunt
c08e78ef73 Prevent .hypothesis artifacts in system test directories
The "run.sh" script, used by "make test", changes the working
directory to the system test directory before executing pytest.
If the test drops hypothesis artifacts while running, this
can cause spurious test failures due to an apparent mismatch
between the contents of the system test directory and the
temporary pytest directory. This has been addressed by having
"run.sh" call pytest from the parent directory instead.
2025-06-03 07:35:18 +00:00
Mark Andrews
4d5aa1b907 fix: nil: Extend named-rrchecker multi-line parsing support
named-rrchecker now parses the braces which support multi-line input 
from the beginning of the input rather than only when reading the 
data fields of the record.

Closes #5336

Merge branch '5336-extend-named-rrchecker-multiline-support' into 'main'

See merge request isc-projects/bind9!10521
2025-06-03 02:27:03 +00:00
Mark Andrews
5f882f95fe Add various multi-line inputs to named-rrchecker 2025-06-03 00:27:03 +00:00
Mark Andrews
2e1f933d65 Extend named-rrchecker multi-line parsing support
named-rrchecker now parses the braces which support multi-line input
from the beginning of the input rather than only when reading the
data fields of the record.
2025-06-03 00:27:03 +00:00
Mark Andrews
029e17844b fix: nil: Silence potential divide by zero warning in qpmulti.c
Coverity flagged a potential divide by zero error in collect in
qpmulti.c when the elapsed time is zero but that is only called
once the elapsed time is greater than or equal to RUNTIME (1/4
second) so INSIST this is the case.

Closes #5329

Merge branch '5329-potential-divide-by-zero-in-qpmulti-c' into 'main'

See merge request isc-projects/bind9!10519
2025-06-02 23:40:43 +00:00
Mark Andrews
081dbb1108 Silence potential divide by zero warning in qpmulti.c
Coverity flagged a potential divide by zero error in collect in
qpmulti.c when the elapsed time is zero but that is only called
once the elapsed time is greater than or equal to RUNTIME (1/4
second) so INSIST this is the case.
2025-06-02 23:07:31 +00:00
Petr Špaček
9ee1f50de0 chg: ci: Revert Run CI danger job even if user canceled it while it was running
Unexpectedly this broke CI job generator which parses gitlab-ci.yaml
and cannot handle `!reference` YAML tags.

This reverts merge request !10490

Merge branch 'revert-0a1a599f' into 'main'

See merge request isc-projects/bind9!10540
2025-06-02 16:11:51 +00:00
Petr Špaček
304638b0b2 Revert "chg: ci: Run CI danger job even if user canceled it while it was running"
This reverts merge request !10490
2025-06-02 15:58:52 +00:00
Petr Špaček
9c0cfa357b fix: doc: named-rrchecker doc improvements
Merge branch 'pspacek/named-rrchecker-docs' into 'main'

See merge request isc-projects/bind9!10516
2025-06-02 14:20:43 +00:00
Petr Špaček
43c5b9aeb4 Fix link to TXT RRtype specification
The odd-looking "\ " escape is required to italicize <character-string>
without italicizing the final "s". See reStructuredText Markup
Specification, sections "Inline markup recognition rules" and "Escaping
Mechanism". Most importantly:

Escaped whitespace characters are removed from the output document
together with the escaping backslash. This allows for character-level
inline markup.
2025-06-02 14:19:59 +00:00
Petr Špaček
46173778ce Add exhaustive examples for named-rrchecker 2025-06-02 14:19:59 +00:00
Petr Špaček
c986d37f24 Clarify named-rrchecker return codes 2025-06-02 14:19:59 +00:00
Petr Špaček
c440c418db Clarify named-rrchecker command line parameters 2025-06-02 14:19:59 +00:00
Petr Špaček
5c370d9e6b Clarify named-rrchecker input format 2025-06-02 14:19:59 +00:00
Petr Špaček
0a1a599fb5 chg: ci: Run CI danger job even if user canceled it while it was running
Merge branch 'pspacek/always-hazard' into 'main'

See merge request isc-projects/bind9!10490
2025-06-02 11:52:35 +00:00
Petr Špaček
33bc2628b7 Run CI danger job even if user canceled it while it was running
Limitation: The after_script is not executed if the job did not start at
all, i.e. if the user canceled the job before it got onto a runner.
See https://gitlab.com/groups/gitlab-org/-/epics/10158
2025-06-02 11:40:46 +00:00
Michal Nowak
f5585b9e8c chg: test: Use "digit" class instead of character range in rndc_dumpdb()
The tr range did not work on Solaris 11.4. Let's use a class that is
defined in POSIX.

Closes #5326

Merge branch '5326-make-rndc_dumpdb-work-on-solaris' into 'main'

See merge request isc-projects/bind9!10530
2025-06-02 11:03:17 +00:00