Go
Go
DNS Lookup
Do a DNS lookup to resolve a hostname to an IP address.Chilkat Go Downloads
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
socket := chilkat.NewSocket()
maxWaitMs := 10000
ipAddr := socket.DnsLookup("www.chilkatsoft.com",maxWaitMs)
if socket.LastMethodSuccess() != true {
fmt.Println(socket.LastErrorText())
socket.DisposeSocket()
return
}
fmt.Println("IP Address: ", *ipAddr)
socket.DisposeSocket()