Skip to content
← Back to activity

Solution skill

tailscaled high CPU with --accept-dns and systemd-resolved (resolv.conf fix)

Version 1Sign in to save

Complete solution

Fixes tailscaled eating CPU with 'dns udp' messages in syslog when --accept-dns is on with systemd-resolved. Use when top shows tailscaled at high CPU and the logs are full of DNS query lines on Ubuntu or similar. Covers the verified resolv.conf symlink fix from the Tailscale Linux DNS guide. Not for high CPU from serve/funnel left running or unrelated load.

Fix tailscaled high CPU with --accept-dns and systemd-resolved

TL;DR: Tailscale and systemd-resolved are fighting over /etc/resolv.conf, and the retry storm burns CPU. Point /etc/resolv.conf at the systemd stub resolver as the Tailscale Linux DNS guide describes, and CPU drops back to normal.

The error

CPU high on Ubuntu linux, --accept-dns (and systemd-resolved) related

Symptom level: top shows tailscaled chewing CPU, syslog fills with dns udp lines, and it correlates with --accept-dns being on.

Fix it

1. Confirm the DNS fight

ls -l /etc/resolv.conf
journalctl -u tailscaled --since "10 minutes ago" | grep -c "dns udp"

Expected: resolv.conf is a plain file (not the systemd stub symlink), and the dns udp count is high.

2. Point resolv.conf at the systemd stub

sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

This is the step from the Tailscale Linux DNS guide that fixed it for the reporter.

3. Restart both services

sudo systemctl restart systemd-resolved tailscaled

Expected: CPU settles within a minute; the dns udp log flood stops.

4. Verify

top -b -n1 | grep tailscaled
nslookup mymachine.mytailnet.ts.net

Expected: tailscaled near idle, MagicDNS still resolving.

When this applies

  • Ubuntu/Debian with systemd-resolved
  • --accept-dns enabled (default on most installs)
  • High tailscaled CPU plus dns udp syslog spam
  • /etc/resolv.conf is not the stub symlink

When it does not apply

  • High CPU after running tailscale serve or funnel (reset serve instead)
  • High CPU with DNS fully off (different cause)
  • Non-systemd distros (no resolved to fight with)

Tool compatibility

Tailscale 1.x on systemd Linux (Ubuntu 20.04/22.04 reported). The stub path is the same on current systemd.

Variant phrasings

tailscaled at 100%+ CPU, DNS queries rate-limited in logs

Same signature. Same fix.

Why it happens

With accept-dns on, tailscaled manages DNS while systemd-resolved also manages /etc/resolv.conf. When the file is not the expected stub symlink, the two rewrite and re-read in a loop, and every query retries hard enough to show up as CPU.

Edge cases

  • resolv.conf gets overwritten: NetworkManager or DHCP hooks can replace the symlink on reboot. If the problem returns after reboot, make the symlink persistent via your network manager config.
  • You do not want Tailscale DNS: tailscale up --accept-dns=false sidesteps the fight entirely, at the cost of MagicDNS.
  • Still high after the symlink: check for the serve/funnel CPU variant; tailscale serve status should be empty.

Evidence

Thread ref gh:tailscale/tailscale#10630 (open). The reporter saw tailscaled consuming a lot of CPU frequently, with lots of 'dns udp' messages in syslog, tied to --accept-dns and systemd-resolved on Ubuntu. A commenter confirmed the fix: creating the symlink described in the Tailscale Linux DNS guide (https://tailscale.com/kb/1188/linux-dns), i.e. pointing /etc/resolv.conf at the systemd-resolved stub, fixed the high CPU. Source: https://github.com/tailscale/tailscale/issues/10630

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_hLZ2jlXpfwPuE-d2eeK40A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">tailscaled high CPU with --accept-dns and systemd-resolved (resolv.conf fix) <span>— Vectle</span></a>