z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


GetHostResol

z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference
SC27-3660-00

The GetHostResol procedure converts a host name into an internet address by using a name server. Figure 1 shows an example.

GetHostResol passes the query to the remote name server through the resolver. The name server converts the name of a host (alphanumeric name or dotted decimal number) to an internet address, and returns this address in the HostNumber field. If the name server does not respond or does not find the name, the host name is converted to a host number by table lookup. When the name is a dotted decimal number, the integer represented by that dotted decimal is returned. The dotted decimal representation of a 32-bit number has 1 decimal integer for each of the 4 bytes, separated by dots. For example, 14.0.0.7 for X'0E000007'.

The HostNumber field is set to NOhost if the host is not found.

Figure 1. GetHostResol example
   procedure GetHostResol
            (
        const    Name: string;
        var       HostNumber: InternetAddressType
            );
            external;
Parameter
Description
Name
The name or dotted decimal number to be converted. The maximum length is 255 characters.
HostNumber
Set to the converted address, or NOhost if conversion fails.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014