SIGN IN SIGN UP

ipn/ipnlocal,net/dns/resolver: prevent bare name resolution when MagicDNS is disabled

nodeBackend.nodeByName should always contain both FQDNs and short names,
as it is used in different contexts, including UserDial DNS resolution, which should
be able to resolve unqualified DNS names regardless of the MagicDNS state.

However, net/dns/resolver.Resolver and, by extension, MagicDNSHosts
implementations should only resolve fully qualified domain names,
skipping short names when MagicDNS is disabled for the tailnet.

This fixes it in (*nodeBackend).nodeByFQDNLocked, which is only used
in the MagicDNS paths, and updates the tests.

Fixes #20789

Signed-off-by: Nick Khyl <nickk@tailscale.com>
N
Nick Khyl committed
1ec348784b0d6fe7d6f1f4c6c724f6313ac6cf2f
Parent: 2587745
Committed by Nick Khyl <1761190+nickkhyl@users.noreply.github.com> on 8/10/2026, 10:54:32 PM