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.
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 understand the issue:
- It's about Tailscale on Linux with systemd-resolved
- When MagicDNS is turned off and there's no global DNS fallback, but there's an app connector, Tailscale fails to register split DNS with the OS to route DNS requests to the app connector.
So the problem is: when you have an app connector configured (which provides split DNS for certain domains), but MagicDNS is off and there's no global DNS fallback, the split DNS routes for the app connector should still be registered with systemd-resolved, but they're not.
Let me explore the repository to understand the codebase structure and find relevant code.
Assistant
Let me explore the relevant DNS-related code and app connector code
Assistant
Let me look at the key files:
Assistant
Let me do one command at a time.
Assistant
Now let me look at the resolved.go file and how DNS configuration is set up for systemd-resolved.
Assistant
Let me look at the DNS manager and the OSConfig, and how the app connector interacts with DNS.
Assistant
Let me see the full compileConfig function and the OSConfig type:
Assistant
Let me look at the Config type and its methods:
Assistant
Let me look at the config.go file more carefully.
Assistant
Let me look at the app connector code to understand how it sets up DNS routes
Assistant
Let me look at how the DNS config is built and where app connector routes are converted to DNS routes
Assistant
Let me look at the dnsconfig_test.go to understand how app connector DNS config is built
Assistant
Let me find and look at the
dnsConfigForNetmapfunctionAssistant
Let me look at the dnsConfigForNetmap function
Assistant
Let me check what CorpDNS means and how prefs relate to MagicDNS
Assistant
Let me read the full
dnsConfigForNetmapfunction to understand the orderingAssistant
Let me understand the relationship between CorpDNS and MagicDNS and how these prefs are set
Assistant
Let me look at the prefs.go to understand CorpDNS better.
Assistant
Now let me look at the exact location of the conn25 code and the early return to understand the fix
Assistant
Now let me see the conn25 code that comes after:
Assistant
Let me understand the relationship between CorpDNS and MagicDNS to better understand the issue
Assistant
Let me look at the test file for DNS config to understand the expected behavior better
Assistant
Let me look at the conn25 file to understand the split DNS mechanism
Assistant
Let me first create a reproduction script to understand the behavior and confirm the issue
Assistant
Let me check the Go environment setup.
Assistant
GOPATH and GOMODCACHE are empty, which means the module cache doesn't exist. Let me try setting them up.
Assistant
Let me set up the full Go environment
Assistant
Let me now look at
compileConfigmore carefully to see if there are additional issues when only DoH routes existAssistant
Let me check where
peerAPIBaseis definedAssistant
peerAPIBasemight be defined elsewhere. Let me search for it.Assistant
Now let me plan and implement the fix. Let me first see the exact lines:
Assistant
Now I understand the issue. The conn25 split DNS routes are added after the
!prefs.CorpDNS()early return check, so when CorpDNS is false (MagicDNS off, no accept-dns), the app connector DNS routes are never added to the config. The fix is to move the conn25 code before this check.Let me implement the fix
Assistant
Let me use the open command properly.
Assistant
Now I'll make the fix. I need to move the
addSplitDNSRoutesfunction definition and the conn25 DNS routes code before the!prefs.CorpDNS()check. Let me do this with an edit.Assistant
Now I need to remove the duplicate
addSplitDNSRoutesdefinition and the old conn25 code. Let me see the current state.Assistant
Let me remove the duplicate
addSplitDNSRoutesdefinition (lines 1020-1034) and the old conn25 code (lines 1070-1086Assistant
Now let me remove the duplicate conn25 code at lines 1054-107
Assistant
Let me verify the final state of the function around the changes
Assistant
Good, the code looks correct. Now let me run the tests to make sure everything passes.
Assistant
All tests pass. Let me also run the broader DNS and app connector tests.
Assistant
Let me also run the appc tests.
Assistant
Now let me also check if there's a secondary issue in
compileConfig: when conn25 routes use DoH URLs,toIPsOnlyreturns empty and the split DNS config is invalid. Let me look at that pathAssistant
I can see there's also a secondary issue. When conn25 routes use DoH URLs,
toIPsOnlyreturns empty, causing an invalid DNS configuration. Let me fix this too by checking the result oftoIPsOnlybefore taking the split DNS shortcutAssistant
Now let me run the tests again to make sure both changes are
Assistant
I accidentally removed the variable definitions. Let me fix this
Assistant
Let me add the
isAppleAssistant
I see that the
ifstatement got corrupted. Let me fix it.Assistant
Now let me run the tests again.
Assistant
All tests pass. Let me run more comprehensive tests.
Assistant
Let me check the diff to ensure my changes are
Assistant
The diff looks clean. Let me run one more round of tests to make sure everything is solid
Assistant
All tests pass. Let me now write a quick verification script to confirm the fix handles the described scenario.
Assistant
Let me clean up and run a final comprehensive test
Assistant
The full build passes. Let me run
go veton the changedAssistant
Let me do a final review of the changes before submitting.
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
- xiaomi/mimo-v2.5-proCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-lunaCompare side by side →
- gpt-5.6-lunaCompare side by side →
- gpt-5.6-lunaCompare side by side →
- gpt-5.6-lunaCompare side by side →
- gpt-5.6-lunaCompare side by side →
deepseek/deepseek-v4-proCompare side by side →