GetHostByName

(Engine-Level Function)

Description:

Calls the WinSock "gethostbyname" function and returns the host name, address(es) and alias names for the named computer. Also returns additional information identifying the network interface that will be used to make a connection from the local machine to an IP returned from GetHostByName.

IP addresses returned from GetHostByName are ordered by decreasing preference of use.

Returns: Array
Usage: Script only.
Function Groups: Network
Related to: WkStaInfo
Format: GetHostByName(Name)
Parameters:  
Name
Required. Any text expression giving the host name, alias, or IP address for which information is required.
Comments:

This function will return details of the TCP/IP interface to the named computer. The return value is an array with three elements comprising a structure as follows:

Element Information

Official host name of the requested computer as known to the system. If using DNS or a similar resolution system, it is the Fully Qualified Domain Name (FQDN) that caused the server to return a reply. If using a local "hosts" file, it is the first entry after the IP address.

An array of addresses.

Each address is a text string giving a "dotted quad" address (xx.xx.xx.xx). If the name being queried is a remote machine, then there will be only one address. If the name being queried is the local machine, then there will be one address for each network interface (including RAS), and no interpretation should be placed on the ordering of the returned addresses.

Invalid, or an array of alias names.

These are alternative names, defined in the local hosts file, by which the target computer may be referenced.

If the name passed to this function is irresolvable as belonging to a computer on the network, the reply will be invalid. Depending upon the network topology, it may be several seconds before this call returns, although other threads in the application will continue to run.