mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-21 02:17:36 +00:00
net/dns: use fallback resolvers as default if they are absent
Otherwise we reset DNS configuration to empty after failing to collect base OS configuration from dns.noopManager, e.g. ``` 2025/05/08 05:48:08 wgengine: Reconfig: configuring DNS 2025/05/08 05:48:08 dns: Set: {DefaultResolvers:[] Routes:{cat-ray.ts.net.:[] ts.net.:[199.247.155.53 2620:111:8007::53]}+65arpa SearchDomains:[cat-ray.ts.net.] Hosts:50} 2025/05/08 05:48:08 health(warnable=dns-read-os-config-failed): error: Tailscale failed to fetch the DNS configuration of your device: getting OS base config is not supported 2025/05/08 05:48:08 health(warnable=dns): error: getting OS base config is not supported 2025/05/08 05:48:08 [v1] authReconfig: ra=false dns=true 0x00: getting OS base config is not supported 2025/05/08 05:48:08 [v1] authReconfig: ra=false dns=true 0x00: <nil> ```
This commit is contained in:
@@ -185,15 +185,15 @@ func (m *Manager) setLocked(cfg Config) error {
|
||||
cfg.WriteToBufioWriter(w)
|
||||
}))
|
||||
|
||||
if !cfg.hasDefaultResolvers() && len(m.forceFallbackResolvers) > 0 {
|
||||
cfg.DefaultResolvers = m.forceFallbackResolvers
|
||||
}
|
||||
|
||||
rcfg, ocfg, err := m.compileConfig(cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if _, ok := rcfg.Routes["."]; !ok && len(m.forceFallbackResolvers) > 0 {
|
||||
rcfg.Routes["."] = m.forceFallbackResolvers
|
||||
}
|
||||
|
||||
m.logf("Resolvercfg: %v", logger.ArgWriter(func(w *bufio.Writer) {
|
||||
rcfg.WriteToBufioWriter(w)
|
||||
}))
|
||||
|
Reference in New Issue
Block a user