An Internet host-name-to-address mapping is represented by the hostent structure:
gethostbyname() maps an Internet host name to a hostent structure, gethostbyaddr() maps an Internet host address to a hostent structure, and inet_ntoa() maps an Internet host address to a displayable string.
The routines return a hostent structure containing the name of the host, its aliases, the address type (address family), and a NULL-terminated list of variable length addresses. The list of addresses is required because a host can have many addresses. The h_addr definition is for backward compatibility, and is the first address in the list of addresses in the hostent structure.