tailscale / tailscale/tailscale
Tailscale still uses "direct" mode for dns when resolv.conf is linked to /run/systemd/resolve/resolv.conf
- Dominant language
- Go
- Stars
- 36.5k
- Forks
- 3.2k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 132
Description
### What is the issue?
I'm on Ubuntu 22.04 using NetworkManager and systemd-resolved. I went over the logic described in the figure in https://tailscale.com/blog/sisyphean-dns-client-linux/ and thought that tailscale should arrive at "Use systemd-resolved."
However in the log it says it's using the "direct" mode, and resolv.conf is overwritten by tailscale. This seems to create DNS loops: Every time I send a DNS request, tcpdump shows thousands of them; then after a while DNS would stop working altogether, with lots of "dns udp query: request queue full" in the logs.
After much debugging, I found that my /etc/resolv.conf is a link to /run/systemd/resolve/resolv.conf, not /run/systemd/resolve/**stub-**resolv.conf as wanted by tailscale's code. Changing the link fixes the issue. But overall, I think tailscale should detect systemd-resolved even if the stub server isn't being used?
### Steps to reproduce
`sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf` and restart tailscale.
### Are there any recent changes that introduced the issue?
_No response_
### OS
Linux
### OS version
Ubuntu 22.04
### Tailscale version
1.38.2
### Other software
NetworkManager, systemd-resolved
### Bug report
BUG-96c93e336ba3e0bb3740a14f9fa491e23a7b037a64e15ea7a9f21a6326e55cfb-20230323124211Z-1bbbee80842ddf94
Contributor guide
Research direction
Reproduce the issue on Ubuntu 22.04 with NetworkManager and systemd-resolved by linking /etc/resolv.conf to /run/systemd/resolve/resolv.conf, then restart tailscale and inspect the DNS mode and query logs. Trace the systemd-resolved detection logic described in the issue and verify that DNS requests no longer loop or fill the request queue when the non-stub resolv.conf link is used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, linux
- Domain
- networking, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100