Lookup the IP address(es) for a host.

Namespace:  JHSoftware
Assembly:  JHSoftware.DnsClient (in JHSoftware.DnsClient.dll) Version: 1.0.1.0 (1.0.1.0)

Syntax

C#
public static IPAddress[] LookupHost(
	string hostName,
	DnsClient..::.IPVersion ipVersion,
	DnsClient..::.RequestOptions options
)
Visual Basic (Declaration)
Public Shared Function LookupHost ( _
	hostName As String, _
	ipVersion As DnsClient..::.IPVersion, _
	options As DnsClient..::.RequestOptions _
) As IPAddress()

Parameters

hostName
Type: System..::.String
The host name to look up. IDNs may be either in native or encoded form (xn--...).
ipVersion
Type: JHSoftware..::.DnsClient..::.IPVersion
The IP version (IPv4 / IPv6) of the IP addresses to return.
options
Type: JHSoftware..::.DnsClient..::.RequestOptions
The options to use with the DNS request.

Return Value

The host's IP address(es)

Exceptions

ExceptionCondition
System..::.ArgumentExceptionInvalid host name or IP version.
JHSoftware..::.DnsClient..::.NoDnsServersExceptionNo DNS servers where specified, and no DNS servers could be found in this computer's IP configuration
JHSoftware..::.DnsClient..::.NXDomainExceptionThe requested domain name does not exist (DNS server returned RCode 3 NXDomain).
JHSoftware..::.DnsClient..::.NoDataExceptionThe requested domain name exists but has no records of the requested type.
JHSoftware..::.DnsClient..::.NoDefinitiveAnswerExceptionNone of the DNS servers returned a definitive answer.

See Also