Sample code for 30+ languages & platforms
Xbase++

DNS Lookup

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

Chilkat Xbase++ Downloads

Xbase++
LOCAL oSocket
LOCAL nMaxWaitMs
LOCAL cIpAddr

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

oSocket := CreateObject("Chilkat.Socket")

nMaxWaitMs := 10000
cIpAddr := oSocket:DnsLookup("www.chilkatsoft.com", nMaxWaitMs)
IF (oSocket:LastMethodSuccess != 1)
    ? oSocket:LastErrorText
    oSocket:destroy()
    RETURN
ENDIF

? "IP Address: " + cIpAddr

oSocket:destroy()