tailscale / tailscale/tailscale

With `direct` DNS manager, MagicDNS settings are not applied on restart

Open
#18,513 1 comment 0 reactions 0 assignees View on GitHub
bug OS-linux
Dominant language
Go
Stars
36.5k
Forks
3.2k
Avg merge
2d 3h
Merged PRs (30d)
123

Description

### What is the issue?

I'm trying to use Tailscale (in a minimal build, although not the most minimal possible) to connect to my IP camera. This mostly works, except that MagicDNS settings are not applied when starting tailscaled. They *are* applied after `tailscale set --accept-dns=false && tailscale set --accept-dns=true`.

Here is how Tailscale identifies system DNS configuration:

```
2026/01/24 18:47:48 dns: [rc=unknown ret=direct]
2026/01/24 18:47:48 dns: using "direct" mode
2026/01/24 18:47:48 dns: using *dns.directManager
```

### Steps to reproduce

1. Build Tailscale 1.94.1 as follows: `GOARCH=arm go build -o tailscale.combined -tags ts_omit_ace,ts_omit_advertiseexitnode,ts_omit_advertiseroutes,ts_omit_appconnectors,ts_omit_aws,ts_omit_bakedroots,ts_omit_bird,ts_omit_c2n,ts_omit_cachenetmap,ts_omit_captiveportal,ts_omit_capture,ts_omit_cliconndiag,ts_omit_clientupdate,ts_omit_cloud,ts_omit_completion,ts_omit_dbus,ts_omit_debugeventbus,ts_omit_debugportmapper,ts_omit_desktop_sessions,ts_omit_doctor,ts_omit_drive,ts_omit_health,ts_omit_hujsonconf,ts_omit_identityfederation,ts_omit_iptables,ts_omit_kube,ts_omit_lazywg,ts_omit_linkspeed,ts_omit_linuxdnsfight,ts_omit_listenrawdisco,ts_omit_logtail,ts_omit_netlog,ts_omit_networkmanager,ts_omit_oauthkey,ts_omit_outboundproxy,ts_omit_peerapiclient,ts_omit_peerapiserver,ts_omit_portlist,ts_omit_portmapper,ts_omit_posture,ts_omit_qrcodes,ts_omit_relayserver,ts_omit_resolved,ts_omit_sdnotify,ts_omit_ssh,ts_omit_synology,ts_omit_syspolicy,ts_omit_systray,ts_omit_taildrop,ts_omit_tailnetlock,ts_omit_tap,ts_omit_tpm,ts_omit_useexitnode,ts_omit_useproxy,ts_omit_usermetrics,ts_omit_useroutes,ts_omit_wakeonlan,ts_omit_webclient,ts_include_cli -ldflags="-s -w" ./cmd/tailscaled`.
2. Install Tailscale on the IP camera (most likely, any Buildroot-based embedded Linux system will work the same; I doubt there's anything specific to my setup here).
3. Authorize via `tailscale up` with MagicDNS enabled.
4. Reboot. Before Tailscale starts, DNS is configured via e.g. `echo "nameserver 1.1.1.1" >/etc/resolv.conf` (there is no resolvconf manager used in the firmware; in practice, the command above is performed by udhcpc).
5. Run `tailscaled`.
6. Observe that `/etc/resolv.conf` is unchanged.
7. Observe that `tailscale dns query google.com` returns SERVFAIL with the following message: `dns: resolver: forward: no upstream resolvers set, returning SERVFAIL`.
8. Run `tailscale set --accept-dns=false && tailscale set --accept-dns=true`.
9. Observe that `/etc/resolv.conf` has been replaced and `/etc/resolv.pre-tailscale-backup.conf` now exists, as expected.
10. Observe that `tailscale dns query google.com` succeeds.
11. Spend about 4-6 hours trying to track this down in Tailscale source code to no avail.

This is reproducible both on v1.94.1 and 3840183be9d0494291ebfaf352b7b1e02a6c26ad.

### Are there any recent changes that introduced the issue?

_No response_

### OS

Linux

### OS version

OpenIPC latest

### Tailscale version

v1.94.1

### Other software

udhcpc, dropbear; nothing that would conflict with Tailscale.

### Bug report

BUG-0000000000000000000000000000000000000000000000000000000000000000-20260124184753Z-2094f6b59d5d0792

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.