SocketTools .NET Edition

DnsClient.HostAliases Property

Return the number of aliases for the specified host name.

[Visual Basic]
Public ReadOnly Property HostAliases As Integer
[C#]
public int HostAliases {get;}

Property Value

An integer value which specifies the number of host aliases.

Remarks

The HostAliases property returns the number of aliases for the host specified by the HostName property. If the specified host name cannot be resolved, this property will return a value of zero.

This property is typically used in conjunction with the HostAlias array.

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 | HostAlias Field