GetHostByName

Read syntax diagramSkip visual syntax diagram SOCKET ( ' GETHOSTBYNAME ' , hostnamefullhostname )

Purpose

Use the GetHostByName function to get the IP address for a specified host name. The name is resolved through a name server, if one is present. GetHostByName returns all the IP addresses for a multihome host.

Parameters

hostname
is the host processor name as a character string.
fullhostname
is the fully qualified host name in the form hostname.domainname.

Return Values

If successful, this function returns a string containing return code 0 and an IP address list. The addresses in the list are separated by blanks. If unsuccessful, this function returns a string containing a nonzero return code, an error name, and an error message.

Examples

Call
Return Values
Socket('GetHostByName','CUNYVM')
'0 128.228.1.2'
Socket('GetHostByName','CUNYVM.CUNY.EDU')
'0 128.228.1.2'

The C socket call is: gethostbyname(name)

Messages and Return Codes

For a list of REXX Sockets system messages, see REXX Sockets System Messages. For a list of REXX Sockets return codes, see REXX Sockets Return Codes.