mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-11 20:00:28 +01:00
[Feature] Adding an option to prevent tailscale clients adding ~. to its DNS search domains for systemd-resolved.
#862
Closed
opened 2025-12-29 02:24:59 +01:00 by adam
·
6 comments
No Branch/Tag Specified
main
update_flake_lock_action
gh-pages
kradalby/release-v0.27.2
dependabot/go_modules/golang.org/x/crypto-0.45.0
dependabot/go_modules/github.com/opencontainers/runc-1.3.3
copilot/investigate-headscale-issue-2788
copilot/investigate-visibility-issue-2788
copilot/investigate-issue-2833
copilot/debug-issue-2846
copilot/fix-issue-2847
dependabot/go_modules/github.com/go-viper/mapstructure/v2-2.4.0
dependabot/go_modules/github.com/docker/docker-28.3.3incompatible
kradalby/cli-experiement3
doc/0.26.1
doc/0.25.1
doc/0.25.0
doc/0.24.3
doc/0.24.2
doc/0.24.1
doc/0.24.0
kradalby/build-docker-on-pr
topic/docu-versioning
topic/docker-kos
juanfont/fix-crash-node-id
juanfont/better-disclaimer
update-contributors
topic/prettier
revert-1893-add-test-stage-to-docs
add-test-stage-to-docs
remove-node-check-interval
fix-empty-prefix
fix-ephemeral-reusable
bug_report-debuginfo
autogroups
logs-to-stderr
revert-1414-topic/fix_unix_socket
rename-machine-node
port-embedded-derp-tests-v2
port-derp-tests
duplicate-word-linter
update-tailscale-1.36
warn-against-apache
ko-fi-link
more-acl-tests
fix-typo-standalone
parallel-nolint
tparallel-fix
rerouting
ssh-changelog-docs
oidc-cleanup
web-auth-flow-tests
kradalby-gh-runner
fix-proto-lint
remove-funding-links
go-1.19
enable-1.30-in-tests
0.16.x
cosmetic-changes-integration
tmp-fix-integration-docker
fix-integration-docker
configurable-update-interval
show-nodes-online
hs2021
acl-syntax-fixes
ts2021-implementation
fix-spurious-updates
unstable-integration-tests
mandatory-stun
embedded-derp
prtemplate-fix
v0.28.0-beta.1
v0.27.2-rc.1
v0.27.1
v0.27.0
v0.27.0-beta.2
v0.27.0-beta.1
v0.26.1
v0.26.0
v0.26.0-beta.2
v0.26.0-beta.1
v0.25.1
v0.25.0
v0.25.0-beta.2
v0.24.3
v0.25.0-beta.1
v0.24.2
v0.24.1
v0.24.0
v0.24.0-beta.2
v0.24.0-beta.1
v0.23.0
v0.23.0-rc.1
v0.23.0-beta.5
v0.23.0-beta.4
v0.23.0-beta3
v0.23.0-beta2
v0.23.0-beta1
v0.23.0-alpha12
v0.23.0-alpha11
v0.23.0-alpha10
v0.23.0-alpha9
v0.23.0-alpha8
v0.23.0-alpha7
v0.23.0-alpha6
v0.23.0-alpha5
v0.23.0-alpha4
v0.23.0-alpha4-docker-ko-test9
v0.23.0-alpha4-docker-ko-test8
v0.23.0-alpha4-docker-ko-test7
v0.23.0-alpha4-docker-ko-test6
v0.23.0-alpha4-docker-ko-test5
v0.23.0-alpha-docker-release-test-debug2
v0.23.0-alpha-docker-release-test-debug
v0.23.0-alpha4-docker-ko-test4
v0.23.0-alpha4-docker-ko-test3
v0.23.0-alpha4-docker-ko-test2
v0.23.0-alpha4-docker-ko-test
v0.23.0-alpha3
v0.23.0-alpha2
v0.23.0-alpha1
v0.22.3
v0.22.2
v0.23.0-alpha-docker-release-test
v0.22.1
v0.22.0
v0.22.0-alpha3
v0.22.0-alpha2
v0.22.0-alpha1
v0.22.0-nfpmtest
v0.21.0
v0.20.0
v0.19.0
v0.19.0-beta2
v0.19.0-beta1
v0.18.0
v0.18.0-beta4
v0.18.0-beta3
v0.18.0-beta2
v0.18.0-beta1
v0.17.1
v0.17.0
v0.17.0-beta5
v0.17.0-beta4
v0.17.0-beta3
v0.17.0-beta2
v0.17.0-beta1
v0.17.0-alpha4
v0.17.0-alpha3
v0.17.0-alpha2
v0.17.0-alpha1
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.16.0-beta7
v0.16.0-beta6
v0.16.0-beta5
v0.16.0-beta4
v0.16.0-beta3
v0.16.0-beta2
v0.16.0-beta1
v0.15.0
v0.15.0-beta6
v0.15.0-beta5
v0.15.0-beta4
v0.15.0-beta3
v0.15.0-beta2
v0.15.0-beta1
v0.14.0
v0.14.0-beta2
v0.14.0-beta1
v0.13.0
v0.13.0-beta3
v0.13.0-beta2
v0.13.0-beta1
upstream/v0.12.4
v0.12.4
v0.12.3
v0.12.2
v0.12.2-beta1
v0.12.1
v0.12.0-beta2
v0.12.0-beta1
v0.11.0
v0.10.8
v0.10.7
v0.10.6
v0.10.5
v0.10.4
v0.10.3
v0.10.2
v0.10.1
v0.10.0
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.1
v0.8.0
v0.7.1
v0.7.0
v0.6.1
v0.6.0
v0.5.2
v0.5.1
v0.5.0
v0.4.0
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.2
v0.2.1
v0.2.0
v0.1.1
v0.1.0
Labels
Clear labels
CLI
DERP
DNS
Nix
OIDC
SSH
bug
database
documentation
duplicate
enhancement
faq
good first issue
grants
help wanted
might-come
needs design doc
needs investigation
no-stale-bot
out of scope
performance
policy 📝
pull-request
question
regression
routes
stale
tags
tailscale-feature-gap
well described ❤️
wontfix
Mirrored from GitHub Pull Request
No Label
enhancement
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/headscale#862
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AlynxZhou on GitHub (Nov 25, 2024).
Use case
systemd-resolved works as a multicast DNS server, which means by default when it queries domains, it will try all available providers, and use the fastest result, unless the domain matches one of DNS search domains of one provider, then it will only use this provider to query.
Tailscale by default registers itself as one of providers of systemd-resolved, but it adds
~.to its DNS search domains, this means all domains will match, and makes systemd-resolved's multicast invalid, all DNS queries go to tailscale's DNS. User may only wants to query tailscale domains via tailscale.Description
Setting
tailcfg.DNSConfig.FallbackResolversinstead oftailcfg.DNSConfig.Resolverscan prevent tailscale clients from adding~.. In previous version this behavior is controlled byoverride_local_dns, but this option is removed because it does not work as intended, and then we lose a way to control this behavior.Is there any chance to add an option to control setting
tailcfg.DNSConfig.FallbackResolversinstead oftailcfg.DNSConfig.Resolvers?Contribution
How can it be implemented?
Just bring back https://github.com/juanfont/headscale/pull/905/files#diff-0e426a43248661127a0c0ee115aef7a1093b635f8993b3f7ebb1dd9f05b8f249R406-R410, but with a better option to describe what it does?
@nblock commented on GitHub (Dec 20, 2024):
The Tailscale SaaS behaves as follows when changing the setting Override local DNS:
When enabled in the control plane, Tailscale configures systemd-resolved as default route (
+DefaultRoute) and alsoconfigures a route-only domain
~.so all domains will match and Tailscale will receive all DNS requests.When disabled in the control plane, Tailscale will not set the default route (
-DefaultRoute) and the route-only domainis not present in the list of DNS domains. It will only handle requests that match the list of domains.
As a workaround, one may configure domains and the default route explicitly on the
tailscale0link and "undo" the DNS override:Likely this will only last until the next network change where tailscale gets a chance to reconfigure DNS.
@st0nie commented on GitHub (Dec 30, 2024):
Another workaround is to set headscale's global dns to empty, in which case the system will not use tailscale's dns to resolve other domains even if
tailscale --accept-dns. But the disadvantage of this workaround is that if the linux system does not usesystemd-resolvedbut uses100.100.100.100as the dns, the system won't be able to resolve domains except headscale domain (because the upstream dns is not set).@Toomoch commented on GitHub (Feb 3, 2025):
This is a big problem, as I can't resolve local domains served by my router's DNS server (.lan) and tailscale names at the same time. It's one or the other with
--accept-dns. Interestingly, in Android everything works correctly.@Devristo commented on GitHub (Mar 24, 2025):
This has hit me in the head a few times as well. I think it also breaks DNS resolution inside my docker containers / k3s containers from time to time, but have not been able to create a clear reproducer. However,
sude tailscale set --accept-dns=falsefixes everything.@VolatileDream commented on GitHub (Apr 12, 2025):
I recently ran into this issue as a result of noticing that mDNS was broken only on Headscale connected Windows machines (which might be a bug, and the behaviour is tracked in https://github.com/tailscale/tailscale/issues/15093). And then noticed that DNS resolution was subtly wrong across a bunch of other devices that connected to Headscale.
I'll lend a perhaps contradictory opinion to this feature request: I don't mind if there's not a setting for this, I think the default should be to use
tailcfg.DNSConfig.FallbackResolvers(equivalent tooverride_local_dns=false) and would be fine if Headscale folks decided that for simplicity sake they wouldn't add the feature.I have worked around the current behaviour by using the config that follows, since my machines are configured to use something other than
100.100.100.100for DNS.edit: I don't mind if there's no setting. 🤦 I dropped the "don't" during editing.
@nblock commented on GitHub (Apr 13, 2025):
I agree, PR https://github.com/juanfont/headscale/pull/2438 also changes the default to align with Tailscale's default behavior.