tcpcmd.lookupDNS
Resolving Addresses

It's often convenient or necessary to find out what domain name is associated with an IP address, or vice versa.

With this verb, you can easily find out that the IP address of scripting.com is:

tcpcmd.lookupDNS ("scripting.com")

returns the string "204.119.90.242".

Conversely,

tcpcmd.lookupDNS ("204.119.90.242")

returns "scripting.com".

This might be helpful for Webstar webmasters who, having disabled DNS lookups in their servers in order to improve performance, still want to resolve the IP addresses logged for each connection. With tcpcmd.lookupDNS, a log processing script could easily provide such a report.

The syntax of tcpcmd.lookupDNS is:

tcpcmd.lookupDNS (addressString)

where

  • addressString

    is a string containing the IP address or domain name of the host who's name or address you want to resolve.

    "scripting.com"
    "204.119.90.242"

Returns

  • a string containing the name or address returned from DNS, or a string containing an error message containing the reason for the error:

    "Error looking up 123.456.78.9: error converting name to address"

  • a script error if addressString is empty or invalid.

Restrictions

There is no user-specified timeOut parameter available for DNS operations. The DNS system has its own timeout (around 120 seconds?).


This page was last built on 8/1/98; 10:28:43 PM ET by Alan German, asg@erols.com. At the moment, I am using Macintosh OS to work on this website. The "Electric Cactus" graphic is based on original artwork owned by UserLand Software and is used with their permission.