tstest/natlab: add a second fake DNS server and split-DNS tests (#20553)
Add a second fake DNS server (4.11.4.12) serving a zone the default one doesn't, so a split-DNS route can be verified: resolving that name proves the query was forwarded there. Tailscale implements a split-DNS route two ways, and a test covers each. When the OS resolver supports split DNS and every route shares one resolver set, tailscaled hands the OS that resolver directly and quad-100 stays out of the query path; TestSplitDNSOSForwarded covers this, reaching the split resolver over a subnet route as a real deployment would. Otherwise the OS is pointed at quad-100, which forwards per-domain itself; TestSplitDNS covers this against both the systemd-resolved and direct backends, along with the other ways a lookup resolves -- answered locally by quad-100 from an extra record or from the netmap, and unrouted names still going to the machine's normal resolver. TestSplitDNSNoMagicDNS covers split DNS on a tailnet with MagicDNS off, which the two above leave out: one has mixed resolver sets but MagicDNS on, the other MagicDNS off but a single resolver set. Together those conditions take a distinct path through compileConfig, where tailscaled reads the OS base resolver config rather than scoping quad-100 to a match domain. Both arrangements produce the same answers, so each test also asserts the guest's resolver state to prove which one it exercised. Fixes tailscale/corp#44798 Signed-off-by: Brendan Creane <bcreane@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
B
Brendan Creane committed
a265908a72ddab93de230a1b1495e252eefa9aee
Parent: 44ec3a1
Committed by GitHub <noreply@github.com>
on 8/7/2026, 12:05:51 AM