26 Commits

Author SHA1 Message Date
Philip Prindeville
9d751f30fd bind: manual fix for IPv6 server unreachable noise
Until we have a failsafe way of detecting no IPv6 internet
connectivity automatically, allow the users to set it
manually for now.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2025-12-12 18:06:44 -07:00
Philip Prindeville
605a457cac bind: save out served domains on service stop
If named gets stopped, then started again, but isc-dhcpd isn't also
restarted, then we want named to at least have the existing content.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2025-12-06 14:05:05 -07:00
David Härdeman
c3a4dc458e bind: don't break IPv6 support
What started in #20183 as a attempt to clean up noise in the logfiles,
turned out to be causing denial-of-service for dual-stack and especially
IPv6-only environments.

Breaking core network functionality cannot possibly be less important
than cosmetic issues, and those affected by log spam can avoid it via
other means (e.g. "query-source-v6 none;" in named.conf).

There's no reliable heuristic for determining whether there's IPv6
connectivity at the time bind is started which will catch any and all
corner cases, as discussed in #26327.

So, remove this logic for now. If a suitable heuristic can be devised,
it can always be added in a subsequent patch, but I have my doubts.

(Also, quote one variable to make shellcheck happy)

Closes: #26327
Closes: #20468

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-19 08:35:38 -07:00
David Härdeman
dc68b66797 isc-dhcp: create zones using rndc
This changes isc-dhcp's init script to create bind zones using the tools
bind provides for that scenario instead of crafting separate zone
configuration by hand.

At the same time, remove the use of /tmp/bind/named.conf.local and add
permissions for dynamic zone creation to bind.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-13 13:36:41 -07:00
David Härdeman
86b84e6775 bind: update conffiles list
The previous patches removed a number of conffiles that weren't necessary,
meaning we can now assume that any changes or additional files in /etc/bind
are things that the user wants to keep.

Since /var/lib/bind is the standard location for longer-lived zone data
(i.e. not zones that secondary servers have obtained via XFER), we symlink
it to /etc/bind/zones so that it survives a sysupgrade.

Temporary files (such as XFER:ed zones for secondaries) stay in
/var/cache/bind.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-13 13:36:41 -07:00
David Härdeman
7d5e909155 bind: update init script
Simplify the init script, removing some unnecessary subshells and make sure
that the end result is shellcheck clean.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-13 13:36:41 -07:00
David Härdeman
2a3454aee0 bind: use default rndc control channel
The present logic recreates what is already the default in bind [1], and writes
the rndc key twice to two different files. In addition, the rndc key is
regenerated every time bind is restarted. Simplify this by relying on the
default behaviour instead.

[1] https://bind9.readthedocs.io/en/latest/reference.html#controls-block-definition-and-usage

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-13 13:36:41 -07:00
David Härdeman
0fdb6d6029 bind: rename named.conf.example
The file actually gets installed as /etc/bind/named.conf, so rename the file to
clarify that.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-13 13:36:41 -07:00
David Härdeman
3e49e7728c bind: remove bind.keys
First, the file is out-of-date.

Second, and more importantly, bind9 includes a compiled-in version which is
up-to-date (see https://www.isc.org/bind-keys/).

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-13 13:36:41 -07:00
David Härdeman
a70bb74683 bind: update db.root
The previous version was quite out of date.

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-13 13:36:41 -07:00
David Härdeman
3452949a08 bind: remove obsolete zone files
Bind9 has native support for these zones via the "empty-zones yes" directive,
which is enabled by default.

(cf. bb1cda792b)

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-13 13:36:41 -07:00
David Härdeman
3150242347 bind: update named.conf
First, change the "directory" to point to /var/cache/bind, which ensures that
e.g. simple file "something" statements for secondary servers will create files
there (the directory is created by the init script, so we're sure that it
exists). This behaviour matches e.g. what Debian does.

Second, remove the "auth-nxdomain" stanza which is the default in bind since
9.0 was released.

Third, change "master" to "primary" (the wording used in the bind reference
docs)

Signed-off-by: David Härdeman <david@hardeman.nu>
2025-09-13 13:36:41 -07:00
Philip Prindeville
b82574b31c named: /var/run/named isn't being created with correct permissions
It needs to be group writable or session.key can't be written once
named drops privileges.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2025-05-27 09:52:49 -04:00
Rucke Teg
93b75d0058 bind: Fix ipv6 detection logic
Bug was introduced in a7b770eec4 and
results in bind always stating with the `-4` flag.

Signed-off-by: Rucke Teg <rucketeg@protonmail.com>
2023-02-05 09:05:30 -08:00
Philip Prindeville
a7b770eec4 bind: start up with -4 if not listening on ipv6 addresses
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2023-01-02 14:15:57 -08:00
Philip Prindeville
9e4485b156 named: don't leak mktemp files on reload
Unless we're using "mktemp -u ..." (not recommended), it will
create the temp file as part of its safety checking.  Thus you
should only create the name (file) if you're going to use it,
and always remove it if you have created it.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2022-03-15 15:20:15 -07:00
Philip Prindeville
daf6b8b212 bind: created /var/run/named directory
Side-effect of dropping capabilities(7) with last commit is now we
need the `/var/run/named/` directory created for us at startup.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-10-31 16:01:44 -06:00
Philip Prindeville
a39a8372b3 bind: deprecate managed-keys
This has been replaced with the "trust-anchors" keyword, per
section 8.21.1 New Features of the Bind 9 Administrator Reference
Manual:

• In order to clarify the configuration of DNSSEC keys, the trusted-keys and managed-keys statements have been deprecated, and the new trust-anchors statement should now be used for both types of key.
  When used with the keyword initial-key, trust-anchors has the same behavior as managed-keys, i.e., it configures a trust anchor that is to be maintained via RFC 5011.
  When used with the new keyword static-key, trust-anchors has the same behavior as trusted-keys, i.e., it configures a permanent trust anchor that will not automatically be updated. (This usage is not recommended for the root key.) [GL #6]

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-10-27 21:49:31 -06:00
Philip Prindeville
52c4c84700 bind: start named early enough to be present when isc-dhcp starts
Start named before dhcpd so that dhcpd can prime the local zones at startup.

Restore the empty domain zone for rfc1918 addresses that previously existed.

Create an additional subsidiary named.conf.local file (initially empty)
in /tmp/bind/ that can be seeded with dynamic zones and primed with
"rndc reload", and add it to the watched list of config files for procd.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2020-12-15 14:03:25 -07:00
Philip Prindeville
31a256f0ab bind: add support for the 'rndc' utility
Enable the control port on named that rncd uses to talk to it. Use
rndc to allow for lightweight reloads of some (per-zone) or all of
the database without an interruption of service.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2020-12-13 13:31:13 -07:00
Noah Meyerhans
6f320da526 bind: Update bind.keys
A multi-year DNSSEC root key update is in progress, as described at
https://www.isc.org/downloads/bind/bind-keys/. This change refreshes the
bind.keys file, ensuring that the new key, in place as of 2018-10-11,
will be recognized and trusted.

Signed-off-by: Noah Meyerhans <frodo@morgul.net>
2018-10-29 08:36:37 -07:00
DonkZZ
707851401c net/bind: Update db.root
The contents of the file "db.root" is very old (12 years).
Here's a new version downloaded from ftp://ftp.internic.net/domain/

Signed-off-by: DonkZZ <donk@evhr.net>
2016-03-20 14:38:15 +01:00
DonkZZ
6cff74db52 net/bind: Little cleaning in named.init
The variable "config_file" appears twice.

Signed-off-by: DonkZZ donk@evhr.net
2016-03-20 14:29:36 +01:00
Noah Meyerhans
1fe4160fc2 net/bind: add the bind user/group
Signed-off-by: Noah Meyerhans <frodo@morgul.net>
2014-12-13 13:08:50 -08:00
Noah Meyerhans
d3d3f1e57b bind: Use procd in /etc/init.d/named
Signed-off-by: Noah Meyerhans <frodo@morgul.net>
2014-12-06 14:11:10 -08:00
Noah Meyerhans
0719636b05 net/bind: Re-import package net/bind from oldpackages.
Signed-off-by: Noah Meyerhans <noahm@debian.org>
2014-08-16 14:51:54 -07:00