Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS reconfig fails when using systemd implementation of resolvconf #631

Closed
danderson opened this issue Aug 1, 2020 · 3 comments
Closed
Labels

Comments

@danderson
Copy link
Member

During bringup on my NixOS system, the DNS config stack detects systemd's implementation of resolvconf (because systemd is in the per-service $PATH generated by NixOS, even though really my system uses openresolv - that's a bug in the NixOS module that I'll fix separately).

However, DNS config fails with:

router: dns up: resolvconf: running /nix/store/7avxs5gsi32ci1v8qpvr3sqc15fnx90q-systemd-243.7/bin/resolvconf -m 0 -x -a tun-tailscale.inet: Unknown interface 'tun-tailscale': No such device

Looks like systemd's shim implementation doesn't like us providing a configuration for a fake interface name 👍

cc @dshynkev

@dshynkev
Copy link
Contributor

dshynkev commented Aug 1, 2020

This also tells me that my heuristic for detecting systemd is imperfect, as resolvconf should never get used when it's the systemd shim. This is probably because systemctl is not in the PATH, which makes sense on NixOS. I wonder: why is resolvconf in the PATH? Is this something you specified in the NixOS unit?

In any case, potentially better heuristics are:

  1. Just check /etc/resolv.conf for 127.0.0.53, which seems to be reasonably unique to systemd, judging from a cursory search. (can I read that file on NixOS? I assume so, for compatibility reasons, right?)
  2. Try to talk to systemd-resolved over DBus and see if I fail. This is probably the most "correct" way to discover it, but I don't immediately see a good way to discover whether resolved is managing DNS or merely serving as a client. On the other hand, we may want to always push our config to resolved as well as whatever else is active; I think it's harmless, if not useful.

@danderson danderson added L1 Very few Likelihood P2 Aggravating Priority level T6 Major usability Issue type labels Aug 14, 2020
@orangeturtle739
Copy link

Is there a workaround for this? I'm hitting the same thing on nixos:

authReconfig: ra=false dns=true 0x01: dns set: running /nix/store/q6ylicsava582g55mdx0788yg2fib7js-systemd-246.6/bin/resolvconf -m 0 -x -a tun-tailscale.inet: Failed to resolve interface "tun-tailscale": No such device

(from journalctl --unit tailscale.service.)

@danderson
Copy link
Member Author

Should be fixed in Tailscale 1.8, our DNS manager detection logic is much improved and should reliably pick resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants