add: a blank fallback DNS field means single-server #171
Loading…
Reference in a new issue
No description provided.
Delete branch "single-server-dns"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The single-server path already existed internally —
dns_2=Noneis handled byset_dns,repin_dns_primary,dnsmasq, and the watchdog gate — but a cleared GUI field saved""rather thanNone, and the empty string passed everyis not Nonecheck. It reachedsystemd-resolve --set-dns=as an empty argument, the whole command failed, and the tunnel came up with no DNS on the link at all: no servers, no~.routing domain. The dnsmasq (--server=) and resolv.conf (nameserver) paths broke the same way.Fix
config.alt_dns_pairnormalizes the two fields at the boundary: blanks and whitespace drop out, order is kept, a cleared primary promotes the fallback, nothing configured comes back as(None, None).set_dns(None, ...)now refuses with a warning instead of breaking the link (both-fields-blank user error stays loud but safe).--set-alt-dnsaccepts a single server and clears the fallback (at most two, as before).One server on the tunnel link means resolved's sticky failover has nowhere to strand a split-horizon primary, so the #95 watchdog never starts there — the Proton app's custom-DNS behavior, opt-in via a cleared field instead of the originally proposed address-class heuristic (#167 was re-scoped accordingly). #170's damping covers everyone who keeps a pair.
Verification
tests/test_config.py(TestAltDnsPair): pass-through, blank fallback, whitespace-only, promoted fallback, nothing configured, missing/null keys.TestSetDns:set_dns(None)touches neither resolved nor resolv.conf and warns.TestManagementEvents.test_single_server_sets_dns_without_watchdog: CONNECTED with a lone server applies it and starts no watchdog.tests/test_mgmt.pyruns separately); ruff E9,F63,F7,F82 andcompileallclean.Closes #167
🤖 Generated with Claude Code