39
)
40
42
>
// lookup localhost and favor the first ipv4 address
43
>
// unless there are only ipv6 addresses available
44
>
ips, err := net.LookupIP(domain)
45
>
if err != nil || len(ips) == 0 {
47
>
return localhostIPDefault
48
>
}
49
for _, ip := range ips {
50
if ip4 := ip.To4(); ip4 != nil {