mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
Updates tailscale/corp#49775 Track authoritative NXDOMAINs for at least 60 seconds on macOS and iOS (where our short SOA ttls are not properly respected), and flush when a cached name becomes resolvable. Compile a no-op tracker elsewhere and avoid duplicate VPN reconfiguration on link changes.
26 lines
697 B
Go
26 lines
697 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build !darwin && !ios
|
|
|
|
package dns
|
|
|
|
import "tailscale.com/feature/buildfeatures"
|
|
|
|
// managerCacheFlush provides no-op cache-flush hooks on platforms without NXDOMAIN tracking.
|
|
type managerCacheFlush struct{}
|
|
|
|
// SetCacheFlushHook is a no-op on this platform.
|
|
func (*managerCacheFlush) SetCacheFlushHook(func()) {}
|
|
|
|
// MaybeCheckCachedDNS is a no-op on this platform.
|
|
func (*managerCacheFlush) MaybeCheckCachedDNS() {}
|
|
|
|
// FlushCaches flushes the platform DNS cache using the native implementation.
|
|
func (*Manager) FlushCaches() error {
|
|
if !buildfeatures.HasDNS {
|
|
return nil
|
|
}
|
|
return flushCaches()
|
|
}
|