SocketTools .NET Edition

DnsClient.HostAlias Field

Returns the aliases for a given host name.

[Visual Basic]
Public ReadOnly HostAlias As HostAliasArray
[C#]
public readonly HostAliasArray HostAlias;

Remarks

The HostAlias array returns the aliases assigned to the host specified by the HostAddress or HostName properties. If the host address or name can be resolved, the first element in the HostAlias array always refers to the host's fully qualified domain name.

The end of the alias list is indicated when the property returns an empty string. The array is zero based, meaning that the first index value is zero.

Example

[Visual Basic]
Dim nIndex As Integer
 
ListBox1.Items.Clear()
dnsClient.HostName = strHostName
 
For nIndex = 0 To dnsClient.HostAliases - 1
    ListBox1.Items.Add(dnsClient.HostAlias(nIndex))
Next
    

See Also

DnsClient Class | SocketTools Namespace | HostAliasArray Class | HostAliases Property