net.LookupHost can be used to resolve hostnames to IP addresses.
net.LookupHost
addresses, err := net.LookupHost("google.com") if err != nil { fmt.Println("Unkown Host") } else { fmt.Println("Addresses:", addresses) }
Source: I Spy Code
Last updated 3 months ago