net/dnsfallback: do not attempt lookups of IPs.
Currently if the passed in host is an IP, Lookup still attempts to
resolve it with a dns server. This makes it just return the IP directly.
Updates tailscale/corp#4475
)
func Lookup(ctx context.Context, host string) ([]netaddr.IP, error) {
+ if ip, err := netaddr.ParseIP(host); err == nil && !ip.IsZero() {
+ return []netaddr.IP{ip}, nil
+ }
+
type nameIP struct {
dnsName string
ip netaddr.IP
