Files
tailscale/net/dns/resolver/negative_cache_stub.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

22 lines
608 B
Go

// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//go:build !darwin && !ios
package resolver
import "tailscale.com/util/dnsname"
// negativeCache is a no-op on platforms without NXDOMAIN tracking.
type negativeCache struct{}
func (*negativeCache) queryGeneration() uint64 { return 0 }
func (*negativeCache) record(dnsname.FQDN, uint64) bool { return true }
// ClearNegativeCache is a no-op on this platform.
func (*Resolver) ClearNegativeCache() {}
// CheckCachedDNS always returns false on this platform.
func (*Resolver) CheckCachedDNS() bool { return false }