HOSTENT  
 

The HOSTENT structure contains information about a domain name, including its IP address and any aliases which may be defined.

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.

Remarks

This structure is intended to be used for backwards compatibility with legacy applications and should not be used with new applications. You cannot use this structure to obtain information for a host which is assigned an IPv6 address. Applications should use the GetHostAddress and GetHostName methods which support both IPv4 and IPv6 addresses.

The application must never attempt to modify this structure or free any of its members. There is no Unicode version of this structure, string pointers will always specify ANSI strings, even if the application is compiled to use Unicode. Only one copy of this structure is allocated per thread, so the application should copy any information it needs before calling any other methods.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: winsock2.h.

See Also

GetHostAddress, GetHostByAddress, GetHostByName, GetHostName