mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-05 23:07:44 +00:00
net/dns: overwrite /tmp/resolv.conf on gokrazy
Appliances built using https://gokrazy.org/ have a read-only root file system, including /etc/resolv.conf, which is a symlink to /tmp/resolv.conf. The system’s dhcp client overwrites /tmp/resolv.conf instead, so we need to use this path in Tailscale, too. related to https://github.com/gokrazy/gokrazy/issues/209 fixes https://github.com/tailscale/tailscale/issues/8689 Signed-off-by: Michael Stapelberg <michael@stapelberg.de>
This commit is contained in:
parent
453620dca1
commit
2a6c237d4c
@ -27,11 +27,6 @@
|
||||
"tailscale.com/version/distro"
|
||||
)
|
||||
|
||||
const (
|
||||
backupConf = "/etc/resolv.pre-tailscale-backup.conf"
|
||||
resolvConf = "/etc/resolv.conf"
|
||||
)
|
||||
|
||||
// writeResolvConf writes DNS configuration in resolv.conf format to the given writer.
|
||||
func writeResolvConf(w io.Writer, servers []netip.Addr, domains []dnsname.FQDN) error {
|
||||
c := &resolvconffile.Config{
|
||||
|
11
net/dns/resolvconfpath_default.go
Normal file
11
net/dns/resolvconfpath_default.go
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build !gokrazy
|
||||
|
||||
package dns
|
||||
|
||||
const (
|
||||
resolvConf = "/etc/resolv.conf"
|
||||
backupConf = "/etc/resolv.pre-tailscale-backup.conf"
|
||||
)
|
11
net/dns/resolvconfpath_gokrazy.go
Normal file
11
net/dns/resolvconfpath_gokrazy.go
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build gokrazy
|
||||
|
||||
package dns
|
||||
|
||||
const (
|
||||
resolvConf = "/tmp/resolv.conf"
|
||||
backupConf = "/tmp/resolv.pre-tailscale-backup.conf"
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user