No split dns registered with the OS with an app connector. What is the issue? It's…
- User
No split dns registered with the OS with an app connector.
What is the issue?
It's possible to have an app connector but tailscale fails to register split dns with the OS to route dns requests to it.
Steps to reproduce
Linux w/ systemd-resolved Turn off MagicDNS No global dns fallback results in Tailscale not being used for DNS by the operating system
Are there any recent changes that introduced the issue?
No response
OS
No response
OS version
No response
Tailscale version
No response
Other software
No response
Bug report
No response
Interface
No new interfaces are introduced.
- Assistant
Now let me look at how the DNS manager decides whether to register with the OS:
- Assistant
Now fix the
compileConfigcondition in manager.go: - Assistant
Let me remove the specific issue number since I can't verify it:
- Assistant
Now add a regression test. Let me check the test helpers first:
- Assistant
Now add the regression test case after
routes-split: - Assistant
All passing, including the new
routes-split-dohcase. Let me run vet and the related ipnlocal DNS tests to be thorough: - Assistant
Transient fork failure during build. Retry with limited parallelism:
- Assistant
All tests pass. The fix is complete.
Summary
Root cause: With an app connector, clients get split DNS routes whose resolvers are DoH URLs pointing at the connector's peerAPI (
https://<peer>/dns-query, built inipn/ipnlocal/node_backend.go:1044). When MagicDNS is off and there are no global resolvers, those DoH routes are the only routes and they all share one resolver, socfg.singleResolverSet()is non-empty.compileConfigthen took the "let the OS do split DNS natively" path (net/dns/manager.go:370), which passes resolvers to the OS viatoIPsOnly(). A DoH URL isn't an IP:53 resolver, so it was filtered out — the OS (systemd-resolved) received match domains with zero nameservers, i.e. no usable split DNS was registered and the OS never sent DNS to Tailscale.(With MagicDNS on, the
ts.net → nilroute breakssingleResolverSet(), forcing the working quad-100 path — which is exactly why the repro requires MagicDNS off.)Fix:
net/dns/config.go— extracted the "plain IP:53, non-DoH-only" resolver check fromhasDefaultIPResolversOnlyinto a newresolversAreIPsOnlyhelper.net/dns/manager.go— the native OS split-DNS path is now only taken when the single resolver set consists of plain IP resolvers. Otherwise the config falls through to the quad-100 proxy path, so the OS is registered with quad-100 as the nameserver plus the app connector domains as match domains, and quad-100 forwards those queries over DoH to the connector.net/dns/manager_test.go— added regression testroutes-split-doh: a split-capable OS with a DoH-only split route now expects quad-100 nameservers + match domains, with the DoH route programmed into the internal resolver.
No new interfaces introduced, per the requirement.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.