DataFlex
DataFlex
DNS Lookup
Do a DNS lookup to resolve a hostname to an IP address.Chilkat DataFlex Downloads
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoSocket
Integer iMaxWaitMs
String sIpAddr
String sTemp1
Boolean bTemp1
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatSocket)) To hoSocket
If (Not(IsComObjectCreated(hoSocket))) Begin
Send CreateComObject of hoSocket
End
Move 10000 To iMaxWaitMs
Get ComDnsLookup Of hoSocket "www.chilkatsoft.com" iMaxWaitMs To sIpAddr
Get ComLastMethodSuccess Of hoSocket To bTemp1
If (bTemp1 <> True) Begin
Get ComLastErrorText Of hoSocket To sTemp1
Showln sTemp1
Procedure_Return
End
Showln "IP Address: " sIpAddr
End_Procedure