DnsLookup
DnsLookup is used to resolve host names into IP addresses. This function is mostly used when you wish to connect to servers and you do not know their IP.
Syntax
DnsLookup(hostname)
Returns
String (IP Address).
Example
Very simple dns lookup and reverse lookup:
Function Main
Dim SocketObject As Object
Dim ServerName As String
Dim IP As String
Dim ResolvedName As String
'Carriage return and line feed
cr = Chr(13) + Chr(10)
ServerName = "whois.networksolutions.com"
echo("Resolving"+cr)
Socket.SetTimeout 5000,5000
ip = socket.DnsLookup(ServerName)
echo(ServerName + " resolves to the IP Address:"+cr )
echo(ip +cr)
ResolvedName = Socket.ReverseDnsLookup(ip)
echo(cr)
echo("IP Address "+ip+ " resolves to "+cr)
echo(ResolvedName+cr)
End Function