Sample code for 30+ languages & platforms
Lianja

DNS Lookup

Do a DNS lookup to resolve a hostname to an IP address.

Chilkat Lianja Downloads

Lianja
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loSocket = createobject("CkSocket")

lnMaxWaitMs = 10000
lcIpAddr = loSocket.DnsLookup("www.chilkatsoft.com",lnMaxWaitMs)
if (loSocket.LastMethodSuccess <> .T.) then
    ? loSocket.LastErrorText
    release loSocket
    return
endif

? "IP Address: " + lcIpAddr


release loSocket