Create /etc/resolv.conf in initramfs for tailscale client

On Debian systems, unless configured by something else, there isn't an
/etc/resolv.conf in the initramfs, which hinders DNS resolution.
Tailscale has its fallback DNS functionality, but that has problems [1]
in the corner-case situation of a Debian initramfs environment:

- no /etc/resolv.conf means tailscale (or golang?) attempts to use
  127.0.0.1 as a DNS resolver
- the loopback interface (lo) isn't brought up in the initramfs. linux
  sends the DNS traffic off-device (destined for 127.0.0.1)

Even with the Tailscale fix for that issue, it's a fallback and there's
a noticeable delay, so do the correct thing here and create
/etc/resolv.conf.

[1] https://github.com/tailscale/tailscale/issues/6110
This commit is contained in:
Paul Aurich
2023-05-03 19:43:14 -07:00
parent 166df1dd88
commit 564c3c3539
3 changed files with 51 additions and 1 deletions

View File

@@ -43,6 +43,18 @@ TAILSCALE_AUTHKEY=
#
#TAILSCALE_LOGOUT=
#
# Space-delimited list of DNS server(s) to put in /etc/resolv.conf in the
# initramfs if /etc/resolv.conf doesn't exist and if no DNS servers were
# returned from DHCP.
#
# Tailscale will eventually fall back to bootstrapping DNS itself, but there's
# no reason to rely on that (adds a slight delay). Tailscale's fallback is
# also problematic in some corner cases in some versions (see
# https://github.com/tailscale/tailscale/issues/6110).
#
#FALLBACK_DNS_SERVERS=
#
# Bring down interfaces matching this pattern before passing out of the
# initramfs. (Same behavior as dropbear-initramfs)