diff --git a/src/net/lookup.go b/src/net/lookup.go index 7f3d20126c902c..e52284ba63255f 100644 --- a/src/net/lookup.go +++ b/src/net/lookup.go @@ -250,6 +250,9 @@ func (r *Resolver) LookupNetIP(ctx context.Context, network, host string) ([]net } ret := make([]netip.Addr, 0, len(ips)) for _, ip := range ips { + if ip4 := ip.To4(); ip4 != nil { + ip = ip4 + } if a, ok := netip.AddrFromSlice(ip); ok { ret = append(ret, a) }