Visual Basic 6.0
Visual Basic 6.0
DNS Lookup
Do a DNS lookup to resolve a hostname to an IP address.Chilkat Visual Basic 6.0 Downloads
' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
Dim socket As New ChilkatSocket
Dim maxWaitMs As Long
maxWaitMs = 10000
Dim ipAddr As String
ipAddr = socket.DnsLookup("www.chilkatsoft.com",maxWaitMs)
If (socket.LastMethodSuccess <> 1) Then
Debug.Print socket.LastErrorText
Exit Sub
End If
Debug.Print "IP Address: " & ipAddr