tailscale/ipn
Brad Fitzpatrick 23ef758c8d ipn/ipnlocal,net/dns/resolver: serve MagicDNS names from live indexes
Every netmap change, including an incremental delta of a single peer,
rebuilt the full MagicDNS state twice: dnsConfigForNetmap walked all
peers to build the dns.Config.Hosts map, and resolver.SetConfig then
walked that map again to build its reverse (PTR) index. On a tailnet
with 10k peers that is a lot of garbage per delta.

Instead, add a resolver.MagicDNSHosts hook, installed once by
LocalBackend, that the quad-100 resolver consults on demand at query
time. It is backed by nodeBackend's nodeByName, nodeByAddr, and peers
indexes, which are already maintained incrementally as netmap deltas
arrive. The subdomain-resolve capability check also moves to the hook
(checking the node's CapMap at query time), so dns.Config's
SubdomainHosts is no longer populated.

dns.Config.Hosts remains for control's DNS.ExtraRecords, which are
few and which feed the split-DNS decisions in dns.Manager's
compileConfig, and on Windows it still carries every node's records
because the hosts-file fallback path (compileHostEntries) needs the
complete enumerable set. Those compileConfig decisions also consulted
the per-node Hosts entries (hasHostsWithoutSplitDNSRoutes), so a new
Config.MagicDNSHostsUnrouted bit preserves that signal now that node
records are not listed: with MagicDNS names present but MagicDNS
domain routing off, quad-100 stays in the OS resolver path.

One small behavior change: reverse (PTR) lookups now also answer for
node addresses whose forward records are filtered out by the
IPv6-suppression rule (issue #1152), since nodeByAddr indexes all node
addresses. Previously such addresses were absent from the pushed
Hosts map and thus from the reverse index.

Updates #12542
Updates tailscale/corp#43949

Change-Id: I63b99199c2b3b124c08cb8bbaea1f63165095294
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-07-13 17:34:01 +00:00
..
auditlog all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
conffile cmd/tailscale/cli, ipn/conffile: accept legacy serve config in set-config (#20056) 2026-06-12 18:52:17 -07:00
desktop all: don't repeat the the word "the" unnecessarily 2026-06-18 16:32:08 +01:00
ipnauth all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipnext ipn/ipnext, feature/routecheck: subscribe routecheck to the IPN bus 2026-07-02 20:26:27 -07:00
ipnlocal ipn/ipnlocal,net/dns/resolver: serve MagicDNS names from live indexes 2026-07-13 17:34:01 +00:00
ipnserver ipn/ipnlocal: consolidate test-only LocalBackend methods behind ForTest 2026-06-27 16:11:42 -07:00
ipnstate all: fix typos where we repeat repeat ourselves 2026-07-03 16:09:03 +01:00
lapitest ipn/ipnlocal: consolidate test-only LocalBackend methods behind ForTest 2026-06-27 16:11:42 -07:00
localapi ipn/localapi,client/local: honour Retry-After on cert rate-limit (#20315) 2026-07-08 13:34:40 +01:00
policy all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
store all: fix typos where we repeat repeat ourselves 2026-07-03 16:09:03 +01:00
backend_test.go ipn: add fmt.Stringer support to NotifyWatchOpt (#20072) 2026-06-18 10:27:16 -07:00
backend.go ipn/{ipn,ipnlocal}: add per-user policy snapshots to IPN bus (#20135) 2026-06-30 12:44:29 -07:00
conf_test.go ipn/config: add RelayServerPort and RelayServerStaticEndpoints to config file (#18300) 2026-06-26 15:45:29 -05:00
conf.go ipn/conf: add ConfigVAlpha.AdvertiseExitNode 2026-07-10 07:24:03 -07:00
doc.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipn_clone.go cmd/tailscale, ipn, feature/remoteconfig: add remote-config support 2026-07-07 12:10:34 -07:00
ipn_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
ipn_view.go cmd/tailscale, ipn, feature/remoteconfig: add remote-config support 2026-07-07 12:10:34 -07:00
prefs_test.go cmd/tailscale, ipn, feature/remoteconfig: add remote-config support 2026-07-07 12:10:34 -07:00
prefs.go cmd/tailscale, ipn, feature/remoteconfig: add remote-config support 2026-07-07 12:10:34 -07:00
serve_expand_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
serve_test.go ipn,ipn/localapi: require local admin to serve Unix domain sockets 2026-06-03 09:45:02 -06:00
serve.go ipn,ipn/localapi: require local admin to serve Unix domain sockets 2026-06-03 09:45:02 -06:00
store_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
store.go ipn/store: make WriteState(id, nil) delete key instead of adding nil entry (#19920) 2026-05-29 11:22:14 -07:00