Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
GETHOSTBYNAME z/OS Communications Server: IP Sockets Application Programming Interface Guide and Reference SC27-3660-00 |
|
Use the GETHOSTBYNAME command to resolve a host name to an IPv4 address. This command uses a DNS server. Any trailing blanks are removed from the host name. If the host is multi-homed, then this command returns a list of the space-delimited IP addresses that are associated with the host name. If the host name is not resolved by the DNS server, then the resolver searches the local hosts tables. For information about the local host tables, see z/OS Communications Server: IP Configuration Guide. Restriction: This command does not support IPv6 addresses.
Tips:
Format>>-SOCKET--(--"GETHOSTBYNAME"--,--------------------------------> >--+-hostname-----------------+--)----------------------------->< '-Fully qualified hostname-' Parameters
Returned valueThis command returns string that contains the return code and one or more space-delimited IPv4 addresses, for example, 0 1.2.3.4 5.4.3.2 1.2.3.5. The return code can be 0 or the REXX API error number. The return code 0 indicates that the requested socket command was completed successfully. See Socket call error return codes for additional information about the numeric error codes that are returned by this command. The following REXX socket API error numbers can be returned:
LE C/C++ equivalent
Code exampleFigure 1. GETHOSTBYNAME command
example
|
Copyright IBM Corporation 1990, 2014
|