hostent

structure that describes an Internet host

Synopsis:

#include <netdb.h>

struct  hostent {
     char    *h_name;     
     char    **h_aliases; 
     int     h_addrtype;  
     int     h_length;    
     char    **h_addr_list;
};

#define h_addr  h_addr_list[0]

Description:

This structure describes an Internet host. It contains either the information obtained from the name server, named, or broken-out fields from a line in /etc/hosts.

The members of this structure are:

h_name
The official name of the host.
h_aliases
A zero-terminated array of alternate names for the host.
h_addrtype
The type of address being returned; currently always AF_INET.
h_length
The length of the address, in bytes.
h_addr_list
A zero-terminated array of network addresses for the host. Host addresses are returned in network byte order.

A #define statement is used to define the following:

h_addr
The first address in h_addr_list; this is for backward compatibility.

Classification:

POSIX 1003.1g (draft)

See also:

endhostent(), gethostbyaddr(), gethostbyname(), gethostent(), sethostent()

/etc/hosts, /etc/resolv.conf, named in the TCP/IP User's Guide