Host Names
This section describes the related network library subroutines which map internet host names to address.
The official name of the host and its public aliases are returned by the gethostbyaddr and gethostbyname subroutines, along with the address family and a null-terminated list of variable length addresses. The list of variable length addresses is required because it is possible for a host to have many addresses with the same name.
The database for these calls is provided either by the /etc/hosts file or by use of a named name server. Because of the differences in the databases and their access protocols, the information returned may differ. When using the host table version of the gethostbyname subroutine, only one address is returned, but all listed aliases are included. The name server version may return alternate addresses but does not provide any aliases other than the one given as a parameter value.