HOSTENT Structure  
 

This structure is used by the GetHostByAddress and GetHostByName methods to return information about a specified host. The application must never attempt to modify this structure or to free any of its components.

Only one copy of this structure is allocated per thread, so the application should copy any information it needs before issuing any other function calls. This is the same data structure used by the Windows Sockets API.

typedef struct _HOSTENT
{
   char *  h_name;
   char ** h_aliases;
   short   h_addrtype;
   short   h_length;
   char ** h_addr_list;
} HOSTENT, *LPHOSTENT;

Members

h_name
The fully qualified domain name (FQDN) that caused the nameserver server to return a reply.
h_aliases
A NULL-terminated array of alternate names.
h_addrtype
The type of address being returned.
h_length
The length, in bytes, of each address.
h_addr_list
A NULL-terminated list of addresses for the host. Addresses are returned in network byte order. The macro h_addr is defined to be h_addr_list[0] for compatibility with older software.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header: Include winsock.h.