How can I prevent Tailscale from overwriting /etc/resolv.conf on Linux?
1
vote
2
answers
1347
views
I'm using Tailscale on a Linux system, but I'm running into an issue with Tailscale's "Magic DNS" feature, which is overwriting my /etc/resolv.conf file and preventing server name resolution.
Here's my setup:
I have Tailscale installed in a directory where tailscale and tailscaled binaries are located.
I start the daemon using a shell script after each boot, which looks like this:
/data/tailscale/tailscaled -no-logs-no-support -statedir /data/tailscale/state
According to the documentation, Magic DNS can be disabled by running
tailscale up --accept-dns=false
which would prevent
/etc/resolv.conf
from being modified.
Since tailscaled is already starting up and enabling Magic DNS (without my explicitly running tailscale up), I’m not sure how to apply the --accept-dns=false
setting before the daemon has a chance to modify /etc/resolv.conf
.
Is there a way to configure Tailscale to disable Magic DNS from the start, or should I modify my startup script to include tailscale up
right after starting tailscaled
?
Any advice on the correct sequence or setup to prevent /etc/resolv.conf
from being overwritten would be greatly appreciated. Thank you!
Asked by Norbert
(131 rep)
Oct 31, 2024, 07:25 AM
Last activity: Jul 6, 2025, 03:17 AM
Last activity: Jul 6, 2025, 03:17 AM