Hello,
We run Knot DNS with one hidden primary and four secondaries. Zone
transfers and NOTIFY go over XoT, with TSIG. Every secondary fails one
refresh about every 6 hours with "handshake failed", and the retry 60 s
later succeeds. We think we see why, and would like to know whether this
is known, and whether Knot could fall back to a full handshake instead.
Has it worked before? It has done this for as long as we have looked
(since early November), on all four secondaries. We changed nothing that
could have started it.
Versions and platform, the same on all five servers:
- Knot DNS 3.6.2-cznic.1~noble, from the CZ.NIC repository
- GnuTLS 3.8.3-1.1ubuntu3.6 (Ubuntu package)
- Ubuntu 24.04, kernel 6.8.0-146/147-generic, KVM virtual machines
What one secondary logs (anonymized, times in UTC):
13:41:11.612 info: [example.net.] refresh, remote 192.0.2.1@853
TLS/0-RTT, key xfr-key., remote serial 1793875167, zone is up-to-date,
expires in 1209600 seconds
13:46:11.613 info: [example.net.] refresh, remote primary, address
192.0.2.1@853, failed (handshake failed)
13:46:11.614 warning: [example.net.] refresh, remote primary not usable
13:46:11.614 error: [example.net.] refresh, failed (no usable master),
next retry at 2026-11-09T07:47:11-0600, expires in 1209300 seconds
13:46:11.614 error: [example.net.] zone event 'refresh' failed (no usable
master)
13:47:11.617 info: [example.net.] refresh, remote 192.0.2.1@853 TLS, key
xfr-key., remote serial 1793875167, zone is up-to-date, expires in 1209600
seconds
The cycle on that secondary, on 2026-11-09:
- 07:46:09: a refresh with a full handshake ("TLS", without 0-RTT).
- Then 71 refreshes over "TLS/0-RTT", one every 300 s
(refresh-max-interval), the last at 13:41:11.
- 13:46:11, 21602 s after the full handshake: "handshake failed". It is
logged about 1 ms after the refresh starts, with a sub-millisecond RTT
to the primary, so it comes on the first exchange, not from a timeout.
- 13:47:11, after retry-max-interval (60 s): a full handshake again, and
a new cycle starts.
The time between two failures is about 21662 s: 6 hours, plus the 60 s
retry, plus the time the refreshes take. All four secondaries follow
this cycle, each with its own phase. The primary was not restarted in
that time, and its reloads did not cause failures.
What we think happens:
- tls-requestor.c takes the pooled session ticket of the remote, loads
it, and enables early data (KNOT_TLS_EARLY_DATA). After each exchange,
the new session goes back to the pool.
- On a resumed session, GnuTLS caps the lifetime of the ticket it issues
at the start of the original session plus expire_time
(lib/tls13/session_ticket.c: "ensure that we don't extend the lifetime
of the ticket past the original session expiration time"). Knot does
not set expire_time, so the GnuTLS default of 21600 s applies: a chain
of resumptions ends 6 hours after its full handshake.
- The first refresh after that point fails with a fatal GnuTLS error
(KNOT_NET_EHSHAKE, "handshake failed") instead of falling back to a
full handshake. We have not captured which GnuTLS error it is.
Impact: low. The retry succeeds a minute later. But each secondary logs
a warning and two errors every 6 hours, and a check on failed refreshes
has to tolerate them.
Expected: when the stored ticket can no longer be used, the refresh does
a full handshake instead of failing.
To reproduce: a primary and a secondary with XoT as below, and any
refresh interval shorter than 6 hours. The first refresh more than 6
hours after the first full handshake fails.
Configuration, anonymized. keys.conf holds the TSIG keys and is left
out. The secondaries also load mod-geoip and mod-stats, which we think
are unrelated.
Secondary:
server:
listen: [ 192.0.2.11@53 ]
listen-tls: [ 192.0.2.11@853 ]
remote:
- id: primary
address: 192.0.2.1@853
key: xfr-key.
tls: on
via: 192.0.2.11
acl:
- id: notify_from_primary
address: 192.0.2.1
key: [ xfr-key. ]
protocol: tls
action: notify
template:
- id: default
refresh-max-interval: 300
retry-max-interval: 60
zone:
- domain: example.net
master: primary
acl: notify_from_primary
Primary:
server:
listen: [ 192.0.2.1@53 ]
listen-tls: [ 192.0.2.1@853 ]
remote:
- id: secondary1
address: 192.0.2.11@853
key: xfr-key.
tls: on
# secondary2 to secondary4 alike
acl:
- id: transfer
address: [ 192.0.2.11, 192.0.2.12, 192.0.2.13, 192.0.2.14 ]
key: [ xfr-key. ]
protocol: tls
action: transfer
zone:
- domain: example.net
notify: [ secondary1, secondary2, secondary3, secondary4 ]
acl: [ transfer ]
If it helps, we can send logs at debug level around a failure, or a
packet capture of a failing handshake.
Thanks,
Thomas
Hello,
I have 2 TXT RR at apex :
domain. TXT "v=spf1...
domain. TXT "google-site-verification=...
I nedd to modify the SPF. From knotc, zone-unset domain. @ TXT remove both.
zone-unset domain. @ TXT "v=spf1... gives an error.
I know I can edit the zone file and reload, but I'd like to be able to do this from knotc. (removing only the spf TXT RR)
--
Erwan David
Hello,
Recently, my hidden master has had two upgrades: one from 3.6.0 to
3.6.1, and another from 3.6.1 to 3.6.2.
I found that the time between "Knot DNS 3.X.Y starting" and "server
started answering" has increased significantly for versions 3.6.1 and 3.6.2.
I have a large DNSSEC-signed zone with about 2,700,000 records, and I
have set |dnssec-validation|to |on|. For versions 3.5.8 and 3.6.0, it
took about 4 minutes to restart; after 3.6.1, it took 47–48 minutes.
Best Regards,
SUN Guonian
Hi,
I'm seeking some clarity over the semantics of 'knotc conf-import'. I'm using
v3.6.1, specifically. When using the +nopurge filter with an existing
configuration database, the operation fails without the use of the -f (force)
option. I'm unclear on the intended semantics. Does +nopurge merge
configuration in the database with settings imported from the file, or does it
just skip the import altogether? Why is the force option required?
$ knotc -f conf-import /usr/local/etc/knot/knot.conf +nopurge
error: use force option to modify/overwrite the existing destination and ensure
the server is not running!
Thanks,
B.C.
Hello,
For a little while, I often see these kind of messages in knot:
oct. 18 06:49:12 arrakeen knotd[1636735]: error: [geekwu.org.] DNSSEC, failed to initialize signing context (PKCS #11 token not available)
When this happens, signature stops, and I only get notified by my monitoring when they're expired :/
Restarting knot is sufficent to get signing running again - no intervention needed on the HSM, the pkcs interface or anything like that.
Do you have an idea of what could happening? How to debug this? (I surely can monitor logs for this message, but it's kind of a pain)
Best regards,
BTW, here's my HSM:
# sudo -u knot pkcs11-tool --module /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so --list-slots
Available slots:
Slot 0 (0x0): Nitrokey Nitrokey HSM (DENK01067960000 ) 00 00
token label : knot
token manufacturer : www.CardContact.dehttp://www.cardcontact.de/
token model : PKCS#15 emulated
token flags : login required, rng, token initialized, PIN initialized
hardware version : 24.13
firmware version : 3.4
serial num : DENK0106796
pin min/max : 6/15
uri : pkcs11:model=PKCS%2315%20emulated;manufacturer=www.CardContact.de;serial=DENK0106796;token=knot http://www.cardcontact.de;serial=denk0106796;token=knot/
Dear Knot developers,
Our Knot DNS systemd unit files do not currently have a "Type"
attribute, so it defaults to "simple". This works quite well. However,
we can set "Type" to one of "notify" or "notify-reload" for better
systemd integration.
For this, Knot DNS needs to support the READY=1, STOPPING=1, RELOADING=1
messages using sd_notify.
Could you please clarify which messages Knot DNS sends?
Regards,
Anand Buddhdev
RIPE NCC
Hello,
I see in the directory with zones and journal I see directories journal.<timestamp>.bak (same for keys and timers) and files journal.<timestamp>.export
time stamp and file date are the moment of upgrade from a knot compiled with lmdb0 to a knot compiled with lmdb1
Can I remove those files or directory ? (I suspect they are used during conversion of mdb files)
--
Erwan David
Since upgrade to knot 3.6, when I restart the knot server, a new serial is generated for the secondary zones,
putting them out of sync with the primary.
Logs in 3.5
Aug 25 10:31:50 ns knot[45038]: info: [domain.] zone will be loaded
Aug 25 10:31:51 ns knot[45038]: info: [domain.] zone loaded from journal, serial 2026023115
Aug 25 10:31:51 ns knot[45038]: info: [domain.] zone file loaded, serial updated 2026023115 -> 2026082500
Aug 25 10:31:51 ns knot[45038]: info: [domain.] loaded, serial none -> 2026082500 -> 2026023115, 21088 bytes, expires in 2137390 seconds
Last line show the serial is set back to the serial of the journal loaded zone
When starting 3.6
Sep 24 07:49:14 ns knot[23114]: info: [domain.] zone will be loaded
Sep 24 07:49:14 ns knot[23114]: info: [domain.] zone loaded from journal, serial 2026023175
Sep 24 07:49:14 ns knot[23114]: info: [domain.] zone file loaded, serial updated 2026023175 -> 2026092400
Sep 24 07:49:14 ns knot[23114]: info: [domain.] loaded, serial none -> 2026092400, 21088 bytes, expires in 2158298 seconds
The serial is not set back to the serail from the journal. As you can see in this case the primary does not use a date based serial number,
thus the secondary is then out of sync and refuses the notifications
--
Erwan David