GuidesRunning & maintaining

Tailscale "DNS config not ideal. /etc/resolv.conf overwritten": fix

Tailscale's resolv.conf was overwritten, usually by a DHCP client, so MagicDNS names stop resolving. Why it happens, how to check, and the lasting fixes.

November 19, 2026The Everpod team
The short answer

Tailscale wrote its own /etc/resolv.conf (pointing at its resolver, 100.100.100.100) and another program, usually a DHCP client or a network manager, wrote over it. It matters for names only: your machines’ MagicDNS names and any split-DNS domains stop resolving from this server, while connections by 100.x address and ordinary internet names keep working. The lasting fix is to give the system one DNS manager Tailscale can work through instead of fighting over the file: where systemd-resolved is available, run sudo systemctl enable --now systemd-resolved, point /etc/resolv.conf at its stub file, and restart tailscaled. Also update to Tailscale 1.94 or later, which rewrites the file back when it is overwritten.

What you see

In tailscale status, under the peer list:

# Health check:
#     - System DNS config not ideal. /etc/resolv.conf overwritten. See https://tailscale.com/s/dns-fight
Copied

Releases up to 1.88 word it Linux DNS config not ideal. /etc/resolv.conf overwritten., under the title “Linux DNS configuration issue”; from 1.90 the text starts “System” and the title is “DNS configuration issue”. Both are the same check, resolv-conf-overwritten, which Tailscale’s reference page documents under its older wording.

What “overwritten” means

Tailscale on Linux works through whatever DNS setup it finds. By its source at 1.104.7, it reads the comment lines at the top of /etc/resolv.conf: a file written by systemd-resolved, NetworkManager or resolvconf usually gets that manager, and Tailscale hands its settings to it. A file with no recognisable owner, or none at all, gets “direct” mode: Tailscale saves the existing file as /etc/resolv.pre-tailscale-backup.conf, writes its own, and puts the backup back when tailscaled stops. Its file starts:

# resolv.conf(5) file generated by tailscale
# For more info, see https://tailscale.com/s/resolvconf-overwrite
# DO NOT EDIT THIS FILE BY HAND -- CHANGES WILL BE OVERWRITTEN
Copied

In direct mode Tailscale watches the file, and the warning is raised the moment its contents differ from what Tailscale wrote, and cleared when they match again. So by a reading of the source, the warning only appears in direct mode. Tailscale’s Linux DNS page names the usual cause: with no DNS manager installed, DHCP clients like dhclient and tailscaled “have no other options than rewriting the /etc/resolv.conf file themselves”, and a lease renewal puts the DHCP server’s resolvers back. The reference page adds a hand-edited or locked file, another network manager overriding the change, tailscaled without the permissions to write it, and a container.

See which case you are in

ls -l /etc/resolv.conf
head -5 /etc/resolv.conf
journalctl -u tailscaled | grep -E 'dns: using|trample'
Copied

The log line dns: using "direct" mode confirms direct mode, and each overwrite logs this line with the new contents, whose header usually names the program that wrote them:

trample: resolv.conf changed from what we expected. did some other program interfere?
Copied

The fixes

Update first. Since a change merged in December 2025, released in 1.94 (January 2026) after a Debian 13 report where tailnet names failed while addresses worked, direct mode writes its file back when another program overwrites it. It gives up after a burst of rewrites a few seconds apart and logs no longer attempting to replace it, so a program that rewrites the file constantly still wins. Releases up to 1.92 only warn. The underlying issue is still open.

Give the machine a DNS manager. This is the fix both Tailscale pages point at, and it ends the fight rather than winning it. With systemd-resolved, Tailscale configures it directly and never touches the file. Its documented setup is the stub symlink:

sudo systemctl enable --now systemd-resolved
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
sudo systemctl restart tailscaled
Copied

systemd-resolved still has to learn the upstream resolvers from whatever brings the network up, so check that a public name and a tailnet name both resolve before you log out. resolvconf is the other documented manager: when /etc/resolv.conf starts with # Generated by resolvconf, Tailscale registers its settings through it.

systemd-resolved is running and it still says this. Then /etc/resolv.conf does not point at 127.0.0.53: either it links to /run/systemd/resolve/resolv.conf instead of stub-resolv.conf, or DNSStubListener=no is set. Programs then read the upstream servers straight from the file, so Tailscale treats it as unmanaged. A Tailscale contributor closing the report gave two fixes: set DNSStubListener=yes and point the file at stub-resolv.conf, or put resolve before dns on the hosts: line of /etc/nsswitch.conf.

Run tailscaled as root. The reference page’s second fix, so that it can change the system’s DNS settings at all. A container is the reference page’s last cause, and Tailscale inside one has wider limits, covered in running Tailscale in a container.

Or take DNS back. If this machine needs no tailnet names, sudo tailscale set --accept-dns=false tells Tailscale not to apply its DNS settings, and in direct mode, by its source, it puts back the file it backed up. MagicDNS names then do not resolve here; reach other machines by their 100.x addresses. Docker containers take their DNS from the host’s file, which is its own trap, covered in Docker containers losing DNS with Tailscale.

Run Claude Code, Codex, OpenCode, Pi, Hermes or OpenClaw on an always-on developer pod.

A developer pod is a permanent cloud computer (VPS), set up and secured for you, with your pick of Claude Code, Codex, OpenCode, Pi, Hermes and OpenClaw installed. Run more agents at once than your laptop can hold, and keep them working when it’s closed. From $24 a month, built in about ten minutes.