CDnsClient::EnumHostAliases Method  
 
INT EnumHostAliases(
  LPCTSTR lpszHostName,  
  LPTSTR *lpszHostAlias,  
  INT nMaxAliases  
);

The EnumHostAliases method returns a list of aliases for the specified host name or IP address.

Parameters

lpszHostName
Pointer to the string that contains the hostname to be resolved. If a fully qualified domain name is not provided, the default local domain will be used. This value may also be an IP address.
lpszHostAlias
Pointer to an array of string pointers which specify one or more host aliases. If the application needs to store these values, a local copy should be made because they are invalidated when another host name is resolved.
nMaxAliases
The maximum number of aliases in the array. This parameter must have a value of at least one, or an error will be returned.

Return Value

If the method succeeds, the return value is the number of host aliases. If the method fails, the return value is DNS_ERROR. To get extended error information, call GetLastError.

Remarks

The application must never attempt to modify the host aliases or to free any of the values. This function calls the GetHostByName method, which uses an internal data structure to store the host information. 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.

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use csdnsav7.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

GetHostAddress, GetHostName