Files
ctrld/cmd/cli
Cuong Manh Le b6d5abfae8 cli: hold NAT64 discovery while the OS resolver predates a network change
After a network change, the OS resolver keeps the previous network's
nameservers until a read finds the new ones. In Standard mode that
usually waits for the recovery to remove ctrld's DNS settings: while
127.0.0.1 is configured, the system reports nothing else, and on macOS
an RDNSS-only IPv6 network has no other source. macOS resolves
ipv4only.arpa through ctrld right after the change to discover the
NAT64 prefix; a fast SERVFAIL from the stale set ends that discovery,
macOS never starts its CLAT, and an IPv4-only upstream never recovers.

On every accepted network change, on all platforms and in both Standard
and intercept mode, mark the OS resolver stale and read the nameservers
once before the re-bootstrap, without the scutil retry loop. While the
set is stale, a failed ipv4only.arpa AAAA lookup gets no reply, so the
host retries it. A read that finds nameservers clears the mark, and the
mark expires after 30s.

Network-change recovery also re-reads the nameservers right after the
reset and then at 1s, 2s, 5s and every 30s while it waits, for networks
that publish their resolvers late.
2026-10-20 17:23:47 +07:00
..
2025-01-24 14:54:20 +07:00