Skip to content

Tailscale still uses "direct" mode for dns when resolv.conf is linked to /run/systemd/resolve/resolv.conf #7655

@Cnly

Description

@Cnly

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions