Files
tailscale/net/dns/manager_nonapple.go
Jonathan Nobels 5cc8aa7f07 net/dns: flush stale MagicDNS NXDOMAINs on Apple platforms (#21584)
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.
2026-10-13 15:48:31 -04:00

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()
}