mirror of
https://github.com/juanfont/headscale.git
synced 2026-01-11 20:00:28 +01:00
[Bug] Windows magic DNS not working in beta2 #763
Closed
opened 2025-12-29 02:23:33 +01:00 by adam
·
48 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
bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/headscale#763
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 @masterwishx on GitHub (Aug 19, 2024).
Is this a support request?
Is there an existing issue for this?
Current Behavior
after updated to beta2 in Windows magic DNS not working , when
nslookup instance-mysite-cloud:Also tryed both :
use_username_in_magic_dns: falseanduse_username_in_magic_dns: truealso have this in config :

Expected Behavior
should work as befor ,aslo in browser cant get to
instance-mysite-cloud:portSteps To Reproduce
...
Environment
Runtime environment
Anything else?
....
@masterwishx commented on GitHub (Aug 19, 2024):
it seems after disconnect and connect again it working in browser , but in cmd still have :
UnKnown cant find instance-mysite-cloud: Non-existent domain@masterwishx commented on GitHub (Aug 19, 2024):
@kradalby should i close issue ?
@masterwishx commented on GitHub (Aug 19, 2024):
Also found that ping for
instance-mysite-cloudinstance-mysite-cloud2etc is workingMaybe
Unknownrelated to Adguard installed in my pc in Win , when disabled : it goes throughAdguard Homein Docker on server. and have next on nslookup :nslookup instance-mysite-cloud:nslookup instance-mysite-cloud2:nslookup instance-mysite-cloud3:etc ...
@kradalby commented on GitHub (Aug 20, 2024):
I have to find a Windows machine to test with, I'll try later in the week.
@kradalby commented on GitHub (Aug 20, 2024):
Can you test if it behavious weirdly without adguard? I would be surprised if it works on other platforms and not Windows as the Tailscale client is what does this, not headscale.
@masterwishx commented on GitHub (Aug 20, 2024):
This is when Adguard in windows is disabled:
https://github.com/juanfont/headscale/issues/2061#issuecomment-2297299391
@masterwishx commented on GitHub (Aug 20, 2024):
Yes on Linux it's OK as was befor
@masterwishx commented on GitHub (Aug 20, 2024):
However this strange nslookup in win, the ping and magicdns is working fine just was need to reconnect
@kradalby commented on GitHub (Aug 20, 2024):
hmm, not sure, sounds like a blip, if anyone else have windows and can chime in, that would be helpful. Otherwise I'll try to test later.
@ygbillet commented on GitHub (Aug 20, 2024):
I upgrade to beta2 (coming from beta1). Running headscale in docker on a vps. 1 windows client, 2 android, 1 linux with subrouter.
My DNS resolver is Adguard Home on my LAN, accessible through my subrouter.
Everything working fine (except timeout on magic dns resolving - already present in beta1)
@kradalby commented on GitHub (Aug 20, 2024):
I am not aware of this issue? Is this a Windows issue? Adguard issue? can you open a ticket with information and steps to reproduce?
@ygbillet commented on GitHub (Aug 20, 2024):
I just started to use headscale. I need to do some test before opening an issue. I could be an edge case or misconfiguration.
@masterwishx commented on GitHub (Aug 20, 2024):
Is this right config for dns when using Adguard home on some machine? I mean to disable the rest like 1.1.1.1?
@kradalby commented on GitHub (Aug 20, 2024):
hmm, so using the adguard IP on the headscale network might be a bit unstable.
You get kind of a bootstrap issue,
just on the top of my head. Dont get me wrong, you can do this, but you need to be aware that you might run into some weird behaviour, this might be the cause of this issue.
@masterwishx commented on GitHub (Aug 20, 2024):
I think it was working fine on beta1, also now
Only strange nslookup in win
So I have Adguard Home on docker in host network, same Ubuntu vps as docker for headscale, also installed tailscale client on same machine.
But if I uncomment cloudflare dns, so clients will not reach Adguard Home dns 100%?
@kradalby commented on GitHub (Aug 20, 2024):
Yes if you add more it will not guarantee I think that they go there.
I think you should probably ask for support for this in discord. We can keep the issue open until we sure, would be great if you test some more.
@masterwishx commented on GitHub (Aug 20, 2024):
Thanks i will test it more and will ask in discord also about what people have in nslookup
@Zeashh commented on GitHub (Aug 27, 2024):
I've had issues with DNS until it's re-enabled in both beta1 and beta2 on my Windows machine. I'm using Pi-hole as my DNS server if that makes a difference. I'm on Windows version 10.0.22631 Build 22631.
I've noticed that restarting
tailscaledresults in the same issue. I'll test this out with Tailscale's control server to see if it's a client or server issue.@Zeashh commented on GitHub (Aug 27, 2024):
Definitely a Headscale/MagicDNS issue. Doing the same service restart with Tailscale as the control server causes no DNS issues. Interestingly enough, after restarting and connecting first to Tailscale and then switching the 'account' to Headscale, DNS stops working again.
@Zeashh commented on GitHub (Aug 27, 2024):
Also on android I get this warning even though DNS works:

@kradalby commented on GitHub (Aug 27, 2024):
@Zeashh but is this a new issue? Or an issue we already had?
@Zeashh commented on GitHub (Aug 27, 2024):
The warning in Android is new, the Windows issue isn't. I was waiting for beta2 before mentioning it due to the DNS changes
@ygbillet commented on GitHub (Aug 28, 2024):
I've the same issue on Android with Tailscale version 1.72.0. Not an issue on my other phone with Tailscale 1.70.0
@kradalby commented on GitHub (Aug 29, 2024):
I am trying to determine if this is a regression between alpha-x, beta1 or beta2. Or if it is an issue that already was present in Headscale prior to 0.22.3.
Based on @ygbillet it sounds like it might be because more errors are now surfaced in the new android version, not necessarily because things have changed in headscale. I know Tailscale has been working on which errors they surface to the users.
regardless, I dont think this is related to the Windows issue described by @masterwishx.
@masterwishx commented on GitHub (Aug 29, 2024):
Also I saw they have some fixes for DNS for android in lasted version
@kradalby commented on GitHub (Aug 29, 2024):
@masterwishx I will close this as an end to the Windows issues? Any Android issues should be opened as a separate issue and it should be tested with multiple headscale and tailscale versions before opening.
I do not have any Android devices so I do not have any opportunity to do this, but I dont think it is related to beta2.
@masterwishx commented on GitHub (Aug 31, 2024):
Have same issue on android
@masterwishx commented on GitHub (Aug 31, 2024):
So it seems this is tailscale android 1.72.0 issue
@Zeashh commented on GitHub (Sep 2, 2024):
The Windows issue is still present, even in beta3. Another thing I've noticed, the issue only occurs if the Tailscale service on Windows starts with "Use Tailscale DNS settings" on. If I start it with that option off and then turn it on, DNS works right away.
@kradalby commented on GitHub (Sep 2, 2024):
I do not have any windows system, can you help me track if this occur in:
@Zeashh commented on GitHub (Sep 2, 2024):
@ygbillet commented on GitHub (Sep 2, 2024):
I've got a different results.
Same behavior on beta2 et beta3.
Configuration
Results
I change DNS resolver 192.168.5.1 (on my LAN - accessible through HeadScale) to 1.1.1.1 (on Internet).
DNS resolver on my LAN is AdGuard Home.
The first two timeout seems normal (in my case). Same result with plain old wireguard on my router or on another peer on my network.
I need to check directly on my LAN.
In your case maybe an issue regarding connectivity to DNS resolver.
Could you ping your DNS server through HeadScale ? And a traceroute
tracert?@kradalby commented on GitHub (Sep 2, 2024):
This sounds like a bootstrap problem is
192.168.5.1is served over a subnet router via tailscale/headscale. First the wg tunnel needs to be established and then it can serve DNS responses.@kradalby commented on GitHub (Sep 2, 2024):
I am not sure if this makes any sense to me, how do you mean that Tailscale does not use any configured DNS?
IIRC, the DNS configruation in this beta should be essentially the same as 0.22.3, so I find this strange.
The change to DNS happened between beta1 and beta2, so I would expect everything before that to be the same. Since it is not, I am inclined to think there might be something with your configuration?
@Zeashh commented on GitHub (Sep 2, 2024):
I retested 0.22.3 and it seems I had missed the "Use Tailscale DNS settings" option earlier because I've now observed completely different behavior.
Aside from 0.22.3, the behavior I describe below is the same on beta2, beta3 and that alpha release I tested.
Did a bit of testing with external/internal DNS servers. If I set an external DNS server (like 1.1.1.1), I can ping and reach my local devices using subnet routers (as I should) and am able to resolve public DNS queries. On 0.22.3 this behavior is slightly different: I'm able to ping my devices, but connecting to, say, RDP over an IP address, doesn't work.
If I set it to my local DNS server, which I should only be able to access through the configured subnet routers, I'm not only not able to access it, nor any other local device (i.e. the subnet route doesn't work at all).
I adapted my newest config (from beta3) to the syntax specified those prior releases (config-example.yaml). Otherwise I've used essentially the same configuration throughout all my testing:
@masterwishx commented on GitHub (Sep 2, 2024):
Do we need to set here base domain or it's added by automatic default?
@kradalby commented on GitHub (Sep 3, 2024):
Added automatically
@ygbillet commented on GitHub (Sep 3, 2024):
First of all, I have no bug with MagicDNS on Windows with a DNS server on my LAN.
I noticed that I had a timeout before the response but the behavior was identical with Wireguard.
I did a few more tests and it turns out that the
nslookupcommand adds the domain suffix.In other words, the request from nslookup to google.fr is translated to google.fr.my.domain.suffix
To avoid this problem, you need to end the FQDN with a dot.:
nslookup google.fr.Obviously, this problem should only exist on a PC attached to a domain.
@kradalby commented on GitHub (Sep 4, 2024):
ah, interesting, thanks for the clarification. But is this a new behaviour for you or did you have with previous versions too?
@kradalby commented on GitHub (Sep 4, 2024):
I am a bit lost, by the way you describe this it sounds more like a routing/subnet router issue than DNS, where the DNS part is more because you cant reach it through the subnet router, more than being an actual DNS issue.
I am also confused to if this is a regression or improvement between 0.22.3 and 0.23.0+ as you mention that the current stable does not work either?
@ygbillet commented on GitHub (Sep 4, 2024):
I only used HeadScale from 0.22.3 (and immediatly upgraded to beta1). The two timeout were always present. My previous comment point out that it's not a TailScale issue but an odd behavior from nslookup on a Windows AD member.
My comment 2 days ago was to point out that, having a configuration similar to op, I don't have any problems under Windows regarding MagicDNS or DNS resolver on LAN. Maybe it could be a routing issue.
@kradalby commented on GitHub (Sep 5, 2024):
@Zeashh
@Zeashh commented on GitHub (Sep 6, 2024):
A wild guess but could this be because the subnet routes depend on other peers which can't be reached through DNS as DNS depends on those routes to begin with? Again wild guess on my part.
I'll do some more constructive testing in an isolated environment later and get back to you. This has been quite chaotic so far, but I'll have some more time this tomorrow/this weekend to test it out thoroughly.
@kradalby commented on GitHub (Sep 6, 2024):
Thank you, I appreciate your testing, as it currently stands, I think this issue is what stands between beta and RC and eventually a release, so I'm quite keen to figure it out. It is a bit hard for me to lab up the whole thing with the resources I have available so it is great that you can do it.
@ygbillet commented on GitHub (Sep 6, 2024):
This shouldn't be a problem if you're using the Tailnet domain or an IP.
To fully understand how MagicDNS works, I recommend the following article: https://tailscale.com/blog/2021-09-private-dns-with-magicdns#how-magicdns-works
In this article, we learn that each TailScale client sets up a DNS server that answers on the Tailnet domain. If it can't answer, it forwards the request to the DNS server specified in the configuration.
Obviously, if connectivity to this server is not operational (routing, firewall), the request will not succeed.
Based on the article, some ideas for testing.
@masterwishx commented on GitHub (Sep 6, 2024):
As posted befor and some other tests, now disabled also Norton Firewall ,Win Adguard is Enabled .
Also have Adguard on node in Magis DNS :
https://github.com/juanfont/headscale/issues/2061#issue-2474012349
in Windows (ping all nodes is working Fine, only strange DNS result when
nslookup) , in Linux Not have this issue.Also when
tailscale status:nslookup hs.mysite.com:route print:
When Win Adguard is disabled then no error in Health check.
when
tailscale status.nslookup hs.mysite.com:nslookup google.com:nslookup instance-mysite.com:but ping also working for nodes and other ...
@Zeashh commented on GitHub (Sep 8, 2024):
I was in the process of writing a HUGE reply with a ton of constructive testing, and then something bizarre™ happened. The original issue was... gone?
Now a bit of context. Actually I'll just paste what I've already written for that reply I've now dropped:
So notice how I've got 2 router peers? Yea well one of them is an RPI with firewalld as its firewall. In short, I noticed that everything worked when the subnet route was set through the other router peer, which doesn't have an OS-level firewall (because it's a VM in Proxmox so I use its firewall, way simpler that way).
And lo and behold, if I run
tailscale downon the RPI, the issue is gone. In other words, Tailscale now always uses the other router peer, which works.The only thing I'm not sure about is why disabling Tailscale DNS and re-enabling it fixes this? And why it only affects Windows as far as we can tell?
I haven't done testing with versions other than beta3 since it was then that I noticed this. Tailscale clients are on versions 1.72.0/1.72.1 for Windows and Linux respectively.
TLDR; firewalld doesn't like Tailscale's subnet routes and there should be testing/documenting done on how this can be achieved, though I personally don't need it. The issue can be closed as far as I'm concerned.
@kradalby commented on GitHub (Sep 9, 2024):
I'm glad you figured it out, I'm going to close this as it seem to be unrelated to the betas and that means we can progress with the releases.
As for the firewalld, Happy for someone to contribute some docs/caveats here, I would argue that they are probably more related to Tailscale than Headscale as I would expect you to see this behaviour with the official SaaS.