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
Interface
No new interfaces are introduced.
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.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /tailscale, current file: none) bash-$
Assistant
Let me start by exploring the repository structure to understand the codebase.
Assistant
Let me look at the
appcdirectory since theissue mentions app connectors.Assistant
Now let me look at the DNS configuration and related code.
Assistant
Let me look at how the app connector's domains interact with DNS config:
Assistant
Let me look at the conn25 feature for split DNS:
Assistant
Now let me look at where the DNS configuration is built:
Assistant
Let me look at the conn25.go for the app connector:
Assistant
Let me look at the dnsConfigForNetmap function in detail to see the issue:
Assistant
Let me search for where AppConnector gets processed in DNS configuration:
Assistant
Let me trace through what happens when there's a conn25 route but no CorpDNS:
Assistant
Let me read the conn25.go test to understand the contract:
Assistant
Now I understand the issue. Let me also check
dnsConfigForNetmapto look more carefully at the early return:Assistant
Let me look at the code flow more carefully:
Assistant
Let me trace through the dns manager compilation for conn25 routes:
Assistant
Let me look more at the conn25 documentation and understand the design intent:
Assistant
</mm:think>
Assistant
</mm:think></mm:think>
Assistant
</mm:think>
Assistant
</mm:think>
Assistant
Let me reproduce the issue first to understand it better.
Assistant
Wait, this would require makingthe function exported. Let me check the function signature:
Assistant
I've successfully reproduced the issue. The
dnsConfigForNetmapreturns an emptyRouteswhenCorpDNSis false, even though there's a conn25 (app connector) route that should be added.Now let me delete the test file and look at how to fix the code:
Assistant
Now let me implement the fix. I'll move the conn25 routes logic before the early return at
if !prefs.CorpDNS():Assistant
Now let me look at the exact code I need to move:
Assistant
Now let me look at the actual issue and the fix carefully. I need to understand if conn25 routes can be added independently of CorpDNS.
Assistant
Let me look at how
AcceptDNSis used in the dns config to understand its purpose:Let me look at howAcceptDNSis used:Assistant
Now let me implement the fix by moving the conn25 routes logic before the early return:
Assistant
Let me make the fix. I'll move the conn25 routes logic before the early return and inline the route addition since
addSplitDNSRoutesis defined later:Assistant
Now let me make the fix by moving the conn25 routes logic before the early return. I'll first see what needs to be replaced:
Assistant
Now let me make the change. First, I'll remove the conn25 block from its current location and add it before the early return:
Assistant
Now let me make the change. I'll use Python to perform the edit to ensure correctness:
Assistant
Let me verify the change:
Assistant
Now let me verify the conn25 block is no longer in its old location:
Assistant
Good. Now let me also verify the rest of the function is still valid:
Assistant
Now let me build the project to make sure my fix compiles:
Assistant
Now let me write a test to verify the fix:
Assistant
The fix works. Now let me clean up the test file:
Assistant
Now let me make sure existing tests pass:
Assistant
All existing tests pass. Now let me run the broader test suite:
Assistant
All tests pass. Now let me also verify the full dns manager logic for the case when only conn25 routes are present (no MagicDNS, no default resolvers). Let me also look at the dns manager's compileConfig to make sure it handles the conn25 case properly:
Assistant
Let me look at the dns manager test for similar scenarios:
Assistant
Let me run all the tests to make sure my fix doesn't break anything:
Assistant
All tests pass. Now let me also check the conn25 logic more carefully to make sure my fix doesn't break anything for the standard case.
Assistant
Let me look at the PickSplitDNSPeers function to confirm it handles edge cases:
Assistant
Let me also run the local tests to make sure I haven't broken anything:
Assistant
All tests pass. Now let me look at the final result of my fix:
Assistant
Let me view the full diff:
Assistant
Let me clean up the extra blank line that resulted from the removal:
Assistant
The diff looks clean. Let me also run the tests one more time to confirm:
Assistant
Let me also check the conn25 tests:
Assistant
All tests pass. Now let me also think about edge cases:
Assistant
Both edge cases pass. Let me also remove the test file since the task says I shouldn't add tests:
Assistant
Let me look at how the conn25 feature actually works:
Assistant
Let me also look at the conn25 test to see if there are tests for the single conn25 route case:
Assistant
Let me also run the conn25-related tests in the ipnlocal package:
Assistant
All conn25 tests pass. Now let me also check if the conn25 logic could be in any other place that I might be missing:
Assistant
Let me also look at how the conn25 feature interacts with the DNS config:
Assistant
Let me look at the conn25 feature code to make sure my understanding is correct:
Assistant
Let me also check the conn25 feature to make sure it doesn't have any other dependencies:
Assistant
Let me check the conn25 documentation:
Assistant
Let me also check the standard app connector to see if it has its own DNS configuration:
Assistant
Let me also verify the change with a more thorough test:
Assistant
Both cases pass. Let me clean up the test file:
Assistant
Let me also check if there are any other places that might use the conn25 routes:
Assistant
Let me do a final review of my fix:
Assistant
Let me also run the broader test suite to make sure everything is still working:
Assistant
All tests pass. Let me also make sure the broader build is OK:
Assistant
The build is successful. Let me also check the diff one more time to confirm the change:
Assistant
Let me also look for any other places where the CorpDNS check might affect conn25 routes:
Assistant
Let me do a final review of my fix:
Assistant
Now let me also check the final state of the file:
Assistant
Let me also run the entire DNS test suite to make sure nothing is broken:
Assistant
All tests pass. The fix is complete and minimal.
Summary of the fix
Issue
The issue is that when MagicDNS (CorpDNS) is off and there's no global DNS fallback, Tailscale fails to register split DNS routes for app connector (conn25) domains. This means the OS doesn't route DNS queries for app connector domains through Tailscale, so the app connector isn't used.
Root Cause
In
ipn/ipnlocal/node_backend.go, thednsConfigForNetmapfunction returns early whenprefs.CorpDNS()is false:if !prefs.CorpDNS() { return dcfg }The conn25 routes (which are needed for app connector split DNS) are added AFTER this early return. So when MagicDNS is off, the conn25 routes are never added to the DNS config.
Fix
Moved the conn25 routes logic to BEFORE the
if !prefs.CorpDNS() { return dcfg }early return. This ensures that conn25 routes are added todcfg.Routeseven when MagicDNS is disabled.Changes
- Added the conn25 routes logic before the early return at
ipn/ipnlocal/node_backend.go:961-990. - Inlined the
addSplitDNSRouteslogic (since the closure isn't defined yet at the new location). - Removed the conn25 routes logic from its original location (after
addSplitDNSRoutes(nm.DNS.Routes)).
Verification
- All existing tests pass (
./net/dns/,./ipn/ipnlocal/,./appc/,./feature/conn25/). - The fix correctly handles the case where MagicDNS is off and there are conn25 routes.
- The fix doesn't affect the case where MagicDNS is on (existing behavior preserved).
Checklist
Based on the issue's checklist, let me go over each point:
-
If an error was reported in the issue description, I have successfully reproduced it. - ✅ Yes, I reproduced the issue by writing a test that verified
dcfg.Routeswas empty whenprefs.CorpDNS()was false, even with conn25 routes available. -
If an error was reported in the issue description, I have confirmed that my fix resolves the error. - ✅ Yes, after my fix, the test confirms that
dcfg.Routesnow contains the conn25 routes even whenprefs.CorpDNS()is false. -
I have thought about edge cases and made sure my fix handles them as well. - ✅ Yes, I considered:
- Multiple conn25 routes (works correctly with the DNS manager's "split config pointing at quad-100" path).
- No conn25 routes (no routes added, as expected).
- MagicDNS on with conn25 routes (existing behavior preserved).
- MagicDNS on without conn25 routes (existing behavior preserved).
- Conn25 with no matching peers (no routes added, as expected).
-
I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. - ✅ Yes, I ran:
./net/dns/tests./ipn/ipnlocal/tests./appc/tests./feature/conn25/tests./ipn/...tests./net/...tests./feature/...tests All tests pass.
- Added the conn25 routes logic before the early return at
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.5-35B-A3BCompare side by side →
- x-ai/grok-4.5Compare side by side →
- x-ai/grok-4.5Compare side by side →
- x-ai/grok-4.5Compare side by side →
- x-ai/grok-4.5Compare side by side →
z-ai/glm-5.2Compare side by side →
claude-fable-5Compare side by side →
claude-fable-5Compare side by side →