Alternative-DNS fallback is one-way: resolved sticks on the second server #95

Closed
opened 2026-08-20 15:37:07 -04:00 by mysticalsoap · 0 comments
Owner

Found live while verifying #34's recipe. systemd-resolved switches away from a failed server but never returns while the substitute keeps answering — and re-applying an identical server list (which set_dns does on every reconnect) does not reset its selection, only a changed list does.

Observed twice in one afternoon: a ping-restart reconnect blipped queries to the primary for about a second, resolved rotated to the fallback, and the system silently served public answers for split-horizon names from then on. The user-visible failure is nasty precisely because nothing looks broken — e.g. LAN Jellyfin resolves to its public address and streams transcode over the WAN for no apparent reason, with no obvious way to notice or fix it.

For a primary/fallback pair the second slot must be a true fallback: used while the primary is down, abandoned as soon as it answers again.

Fix shape:

  • A service-side watchdog while a tunnel with alternative DNS is up: read the link's current server (resolve1 D-Bus CurrentDNSServer — no text parsing), and when it is not the primary, probe the primary directly with one UDP query; if it answers, force re-selection (set the primary alone, then the pair) and flush caches so the fallback's answers don't linger. Bounded staleness of one check interval instead of forever.
  • --strict-order for the bypass dnsmasq, which otherwise has its own favour-the-working-server stickiness.
  • The no-resolved /etc/resolv.conf path already has true priority semantics (glibc tries nameservers in order per query) and needs nothing.
Found live while verifying #34's recipe. systemd-resolved switches away from a failed server but never returns while the substitute keeps answering — and re-applying an identical server list (which set_dns does on every reconnect) does not reset its selection, only a *changed* list does. Observed twice in one afternoon: a ping-restart reconnect blipped queries to the primary for about a second, resolved rotated to the fallback, and the system silently served public answers for split-horizon names from then on. The user-visible failure is nasty precisely because nothing looks broken — e.g. LAN Jellyfin resolves to its public address and streams transcode over the WAN for no apparent reason, with no obvious way to notice or fix it. For a primary/fallback pair the second slot must be a true fallback: used while the primary is down, abandoned as soon as it answers again. Fix shape: - A service-side watchdog while a tunnel with alternative DNS is up: read the link's current server (resolve1 D-Bus `CurrentDNSServer` — no text parsing), and when it is not the primary, probe the primary directly with one UDP query; if it answers, force re-selection (set the primary alone, then the pair) and flush caches so the fallback's answers don't linger. Bounded staleness of one check interval instead of forever. - `--strict-order` for the bypass dnsmasq, which otherwise has its own favour-the-working-server stickiness. - The no-resolved /etc/resolv.conf path already has true priority semantics (glibc tries nameservers in order per query) and needs nothing.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mysticalsoap/aqomui#95
No description provided.