ISSUE DESCRIPTION No split dns registered with the OS with an app connector. What is the…
- User
ISSUE DESCRIPTION
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
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
- Assistant
I’ll first map the DNS configuration path and locate app-connector-specific logic and tests. Then I’ll reproduce the configuration omission at the unit-test/package level, make the smallest general fix, and run the affected test suites.
- Assistant
The OS manager already supports empty-resolver split routes (the internal resolver handles them), so the likely bug is earlier: the network map’s app-connector domains are not being included in the DNS configuration under the no-MagicDNS/no-global-resolver combination. I’ll trace how network-map DNS routes become
dns.Configand identify the condition that suppresses OS registration. - Assistant
dnsConfigForNetmapcontains dedicated connector split-DNS construction around lines 1035–1049. I’ll inspect that function and its existing connector test cases, especially their expectedOnlyIPv6/route/search-domain behavior, to isolate the exact missing condition without changing unrelated DNS semantics. - Assistant
The netmap conversion does produce the connector route even with no global resolver, matching the existing test. Therefore the omission occurs when
net/dns.Managertransformsdns.Configinto OS and resolver configurations. I’ll inspect the split-DNS compilation matrix and run the existing connector case through it under Linux/systemd-resolved-like capabilities. - Assistant
The manager has distinct “direct upstream split DNS” and “route via local resolver” branches. Connector resolvers are HTTP peer-API URLs, which the OS cannot consume directly; they must cause the local Tailscale resolver address to be registered with connector domains as
MatchDomains. I’ll inspect the branch predicates and compare tests for DoH/non-IP route targets, where this distinction is already modeled. - Assistant
I found the reproducible defect: a single connector URL resolver satisfies
singleResolverSet(), so Linux enters the native split-DNS fast path.toIPsOnlythen drops the URL, leavingNameserversempty whileMatchDomainsis set, and the route is also absent from the internal resolver config. The fast path must only apply when every resolver is an OS-usable plain IP; URL/DoH/port-bearing resolvers must use Tailscale’s local resolver. I’ll confirm helper semantics and implement that constraint in production code. - Assistant
The existing
hasDefaultIPResolversOnlydocuments exactly the required eligibility rule, including rejecting custom ports and DoH-only public IPs. I’ll factor its per-list check into a reusable helper and use it for the single split resolver set. This avoids a weaker length comparison and preserves special handling for IPs that must be reached through Tailscale’s DoH forwarder. - Assistant
The production fix is in place. To verify the reported scenario without modifying tests, I’ll first run the complete
net/dnssuite. Then I’ll create a temporary in-package test (removed immediately afterward) that feeds one app-connector-style HTTP resolver route, no MagicDNS route, and no defaults into a split-DNS-capable Linux manager, asserting the OS receives Tailscale service IPs plus the connector match domain and the internal resolver retains the URL route. - Assistant
The test command was blocked by environment configuration (
GOMODCACHEandGOPATHare both unset), not by code. I’ll rerun with an isolated writable GOPATH under/tmp; this does not alter repository files. - Assistant
Dependencies downloaded successfully, but Go also requires a build cache because
HOMEis unset. I’ll supply/tmp/gocacheand rerun the same affected suites. - Assistant
All affected existing suites pass. I’ll now execute the targeted temporary regression test described above. It directly reproduces the former empty-
Nameserversoutput and validates both halves of the fix: systemd-resolved registration (MatchDomains+ service IPs) and forwarding through the internal resolver. The temporary test file will be removed by a shell trap regardless of outcome. - Assistant
The targeted reproduction now passes, and its temporary file was removed. The eligibility helper also handles the key edge cases: custom-port resolvers, URL resolvers, and DoH-only IP resolvers remain behind the local proxy; only ordinary port-53 IP resolvers are delegated directly to the OS. I’ll perform final repository hygiene and diff review, then rerun the focused package with cache disabled to ensure the result is not stale.
- Assistant
The hygiene check caught that the temporary regression file remained despite the prior shell
EXITtrap (the execution wrapper evidently did not trigger it as expected). I’ll remove it explicitly now, verify only production files remain, and repeat the uncached package test.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.