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