mirror of
https://github.com/tailscale/tailscale.git
synced 2026-10-09 11:52:00 -04:00
logtail's dialer only used dnscache in its fallback path, and built a new Resolver per dial there, so every new connection to the log server did a fresh DNS lookup (twice when the first dial failed). On systems without a caching resolver, that adds up to a lot of queries for log.tailscale.com. Share one dnscache.Resolver across all log dialers, and have the bootstrap path go straight to dnsfallback rather than repeating the regular lookup. Since the cache TTL is a fixed guess, make dnscache.Dialer expire a cached entry and look the host up again when dialing its cached IPs fails, so a moved host isn't stuck on stale IPs. Updates #15326 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> Change-Id: I6a55d72a73ed878faebc15317421a54d9ae293ca