The following is a list of host-related calls:
The gethostbyname() call takes an internet host name and returns a hostent structure, which contains the name of the host, aliases, host address family and host address. The hostent structure is defined in the <NETDB.H> header file. The gethostbyaddr() call maps the internet host address into a hostent structure.
The database for these calls is provided by the name server or the ETC\HOSTS file if a name server is not present or is unable to resolve the host name.
The sethostent(), gethostent(), and endhostent() calls open, provide sequential access to, and close the ETC\HOSTS file.
The gethostname() call gets the name for the local host machine.
The gethostid() call returns an integer that identifies the host machine. Host IDs fall under the category of internet network addressing because, by convention, the 32-bit internet address is used.