Repository navigation
Description
What is the issue?
On a Linux system with a specific DNS setup, if tailscaled is terminated without being given a chance to cleanup, DNS breaks.
This specific setup is:
- no
systemd-resolvedconfigured /usr/sbin/resolvconfexists as a symlink toresolvectl- no global nameservers configured for the Tailnet
/etc/resolv.confis a regular file (i.e not a symlink)
This is the out-of-the-box configuration for an exe.dev VM. The VM image is based off Ubuntu 24.04.4 LTS (kernel 6.12.67).
I can reproduce on Tailscale versions 1.94.2 and 1.96.2.
Root Cause
After an unclean shutdown (crash, SIGKILL, power loss), tailscaled misdetects the system's DNS manager.
- The unclean shutdown skips
ExecStopPost=/usr/sbin/tailscaled --cleanup, so the Tailscale-written/etc/resolv.confpersists. This file contains a comment with the phraseresolvconf-overwrite. - On restart,
resolvOwner()seesresolvconf-overwritein the stale/etc/resolv.confand incorrectly returnsresolvconf. resolvconfStyle()finds/usr/sbin/resolvconf(a symlink toresolvectlon Ubuntu 24.04), doesn't recognize it as Debian resolvconf, and returnsopenresolv.- The openresolv manager calls
resolvconf -i, which fails because/usr/sbin/resolvconfis actually resolvectl (via symlink), which does not supportopenresolv's -iflag. - This prevents Tailscale's DNS resolver from starting correctly. DNS resolution breaks entirely.
Graceful shutdowns are unaffected because --cleanup restores the original /etc/resolv.conf from backup, allowing Tailscale's DNS resolver to start correctly.
Steps to reproduce
Reproduced on a clean exe.dev VM.
# Install Tailscale and authenticate
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --auth-key=<YOUR_AUTH_KEY>
# Verify DNS works
dig google.com @100.100.100.100 +short +timeout=3
ping google.com
# Simulate unclean shutdown
sudo kill -9 $(pidof tailscaled)
# Restart tailscaled (simulates system recovery after crash/power loss)
sudo systemctl start tailscaled
# Verify that DNS is now broken
dig google.com @100.100.100.100 +short +timeout=5
ping -c 1 -W 3 google.com
# Confirm buggy DNS management detection in logs
sudo journalctl -u tailscaled --since "5 min ago" --no-pager | grep "rc="
# on my system, prints something like rc=resolvconf resolvconf=openresolv ret=openresolvAre there any recent changes that introduced the issue?
No response
OS
Linux
OS version
exe.dev's customized Ubuntu 24.04.4 image
Tailscale version
1.94.2, 1.96.2
Other software
No response
Bug report
BUG-83fbf900f22405afb9f4178bb7a66859771c46b6627255d1e3cd201f707e3ef9-20260320172407Z-3b83535918838606
Activity
[-]DNS broken after unclean shutdown[/-][+]DNS resolution broken after unclean shutdown[/+][-]DNS resolution broken after unclean shutdown[/-][+]MagicDNS/DNS resolution broken after unclean shutdown[/+]dwroblewski commentedon May 20, 2026
Hitting this on Debian 12 / GCE / tailscale 1.96.4 with a much more common
repro than
kill -9: a routine cloud-console Stop is enough. We hit it thefirst time we stopped the VM to resize the boot disk.
Environment
6.1.0-48-cloud-amd64debian-121.96.4systemd-resolved 252.39-1~deb12u2, no NetworkManager/sbin/resolvconfand/usr/sbin/resolvconfare both symlinks to/usr/bin/resolvectl, shipped by thesystemd-resolvedpackage itself onbookworm
/etc/resolv.confwas a regular file containing tailscale'sresolvconf-overwritemarker from the previous bootMisdetection chain matches your analysis exactly:
exit status 1comes from the shim rejecting an openresolv flag:Why clean shutdown wasn't enough.
journalctl -u tailscaled -b -1 | tailfrom the previous boot has no
--cleanuplines — theExecStopPost=/usr/sbin/tailscaled --cleanupapparently didn't complete beforethe hypervisor cut power, even though systemd recorded a normal shutdown
(
systemd-logind: Power key pressed short.). The stale marker file survives.Fix that worked.
Removes the
resolvconf-overwritemarker thatresolvOwner()keys on, andgives
resolvconfStyle()thestub-resolv.confmarker it uses to recognizethe systemd-resolved-stub layout. After restart:
End-to-end resolution restored, no health warnings.
What didn't work.
systemctl restart tailscaledalone — stale file still has the marker, samemisdetection.
tailscale set --accept-dns=false— suppresses the symptom but leaves thestale file and kills MagicDNS.
Triage note. Cloud-console Stop is the standard way to perform disk
resizes, instance-type changes, and reboots-on-stuck-VM on GCE/AWS/Azure. The
kill -9repro in the original report surfaces the bug in isolation; thispath is what users actually hit during routine ops. Re-running
--cleanuponstartup if the marker file is found (or detecting the systemd-resolvconf shim
by checking whether
resolvconf -iaccepts the flag) would close this withoutneeding user intervention.
M1llenia commentedon Aug 26, 2026
I had a similar issue to this that I had to solve. Full disclosure, I'm a complete Github noob and I was using Claude to assist me in troubleshooting my issue + formatting a response below that follows Github etiquette/rules, so please forgive me for any content/formatting mistakes. I will do my best to provide any further information if I can.
Confirming this on a different environment — Ubuntu 24.04, Pangolin + Traefik stack, Tailscale 1.102.2
Same log signature as the original report:
/etc/resolv.confwas a regular file (not a symlink),/usr/sbin/resolvconfsymlinked toresolvectl, matching the described trigger conditions.I can't confirm the exact unclean shutdown that caused it — I noticed the symptom (SERVFAIL on all non-tailnet DNS) with no corresponding change in my Tailscale admin console or local config, so it's consistent with this happening silently after a restart/reboot I didn't directly observe, exactly as described in the root cause section.
Downstream impact worth noting: the breakage cascaded well beyond MagicDNS in my case — Traefik couldn't renew Let's Encrypt certs, failed to load its badger middleware plugin at boot (plugin fetch needs DNS), which broke every router including Pangolin's own dashboard, and Newt couldn't fetch its auth token from Pangolin's API. So on a Pangolin-based stack this one bug can take down the entire reverse proxy, not just name resolution.
Confirmed fix:
Then a restart of the Traefik container to force it to re-fetch its plugins and re-poll Pangolin's config endpoint. I also had to refresh Pangolin's license keys.
Happy to provide
journalctl -u tailscaledoutput covering the actual break if that's useful for tracking down what triggers the initial misdetection.samoht9277 commentedon Sep 4, 2026
Hitting this on Debian 12 with 1.102.2, with one difference from the original report that I think is worth adding: systemd-resolved is running and reachable here, and it still lands in openresolv mode. The issue text lists "no systemd-resolved" as a precondition, so I almost ruled this out before I looked at the probe line.
Environment:
systemd-resolvedactive/sbin/resolvconfand/usr/sbin/resolvconfare both symlinks to/usr/bin/resolvectlopenresolvnor Debianresolvconfis installed, and there is no/etc/resolvconfor/run/resolvconf/etc/resolv.confwas a regular file left over from an earlier tailscaled runThe trigger was an ordinary reboot. No crash, no
kill -9, nothing else on the box changed.Straight after boot:
Note
resolved-ping=yes. resolved answered the ping, butrc=resolvconfshort-circuits before that result is ever used.What made this slow to diagnose is that the resolver is only half broken. MagicDNS names resolve fine, because tailscaled answers those itself. Every public name gets SERVFAIL. It reads like an upstream DNS outage rather than a local misdetection.
This matches the chain already described in the issue. The header tailscaled writes into
/etc/resolv.confcontains:so the substring search finds "resolvconf" inside tailscale's own comment and concludes that resolvconf owns the file.
Fix on the same box, no package changes:
One gotcha if anyone else applies this. tailscaled has to be stopped before you swap the file. If it is still running it rewrites
/etc/resolv.confback to its own version within a few seconds, so the restart reads that and picks openresolv all over again. I broke a second machine that way before I spotted it.Scale here: one machine broke on its own after a reboot. A second reproduced it the moment tailscaled restarted with the plain-file resolv.conf still in place. Four more had the identical shape and I converted them before they got the chance.
raggi commentedon Sep 9, 2026
It appears exe.dev masks out systemd-resolved:
The painful part is this is a misleading way to disable the service, it'd be ideal (selfishly for us) to not leave most of the system looking like resovled should be present.
Anyway that aside, our handling of the case here needs to improve, we need to recover from unclean shutdown better and we need to improve our detection to better identify a case like this.
exeuntu: purge unused systemd-resolved
openvpn3-on-demand — check that programs resolve through systemd-reso…
openvpn3-on-demand — check that programs resolve through systemd-reso…
NeilJed commentedon Oct 20, 2026
Another data point on Amazon Linux 2023. It has the same root cause as described above, and a reboot does not recover it.
Environment
--accept-dns=true/etc/resolv.confis the AL2023 default, a symlink to/run/systemd/resolve/resolv.conf(not the 127.0.0.53 stub). Tailscale therefore runs indirectmode and replaces it with its own file./usr/sbin/resolvconf -> ../bin/resolvectl(shipped bysystemd-resolved)What happened
tailscaledhad run fine in direct mode for about two weeks. During an AWS SSM Patch Manager run, systemd packages were upgraded andsystemd-resolvedandsystemd-networkdwere restarted. In the same run the kernel OOM killer killedtailscaled(the host has 916 MB RAM and no swap, anddnfwas using about 520 MiB at the time):So this is the unclean-exit case described above. systemd then restarted it through
Restart=on-failure(Scheduled restart job, restart counter is at 1). After the restart:All non-tailnet lookups failed, including the SSM agent's endpoint, so the instance dropped off SSM until we intervened.
Notes
https://tailscale.com/s/resolvconf-overwrite) makesresolvOwner()returnresolvconf.resolvconfStyle()then treats theresolvectlsymlink as openresolv, andresolvconf -i/-lexits 1./etc/resolv.confstays on disk. TheExecStopPostrun oftailscaled --cleanupstraight after the kill also loggedusing "openresolv" mode, so the originalresolv.conf(kept as/etc/resolv.pre-tailscale-backup.conf) is never restored.tailscale set --accept-dns=falserestores DNS, but it turns Tailscale DNS off (as noted earlier in this thread).mv -f /etc/resolv.pre-tailscale-backup.conf /etc/resolv.conf) and restarttailscaled. It loggedrc=resolved resolved=not-in-use ret=directandusing "direct" modeagain, and--accept-dns=truethen worked normally.resolvOwner()skip a file thatownedByTailscale()recognises (its header containsgenerated by tailscale), or avoid the substringresolvconfin the header.