Dns Dns Dns Dns Class

Definition

Provides simple domain name resolution functionality.

public ref class Dns abstract sealed
public static class Dns
type Dns = class
Public Class Dns
Inheritance

Examples

The following example queries the DNS database for information on the host www.contoso.com.

IPHostEntry^ hostInfo = Dns::GetHostEntry( "www.contoso.com" );
IPHostEntry hostInfo = Dns.GetHostEntry("www.contoso.com");
Dim hostInfo As IPHostEntry = Dns.GetHostEntry("www.contoso.com")

Remarks

The Dns class is a static class that retrieves information about a specific host from the Internet Domain Name System (DNS).

The host information from the DNS query is returned in an instance of the IPHostEntry class. If the specified host has more than one entry in the DNS database, IPHostEntry contains multiple IP addresses and aliases.

Methods

BeginGetHostAddresses(String, AsyncCallback, Object) BeginGetHostAddresses(String, AsyncCallback, Object) BeginGetHostAddresses(String, AsyncCallback, Object) BeginGetHostAddresses(String, AsyncCallback, Object)

Asynchronously returns the Internet Protocol (IP) addresses for the specified host.

BeginGetHostByName(String, AsyncCallback, Object) BeginGetHostByName(String, AsyncCallback, Object) BeginGetHostByName(String, AsyncCallback, Object) BeginGetHostByName(String, AsyncCallback, Object)

Begins an asynchronous request for IPHostEntry information about the specified DNS host name.

BeginGetHostEntry(IPAddress, AsyncCallback, Object) BeginGetHostEntry(IPAddress, AsyncCallback, Object) BeginGetHostEntry(IPAddress, AsyncCallback, Object) BeginGetHostEntry(IPAddress, AsyncCallback, Object)

Asynchronously resolves an IP address to an IPHostEntry instance.

BeginGetHostEntry(String, AsyncCallback, Object) BeginGetHostEntry(String, AsyncCallback, Object) BeginGetHostEntry(String, AsyncCallback, Object) BeginGetHostEntry(String, AsyncCallback, Object)

Asynchronously resolves a host name or IP address to an IPHostEntry instance.

BeginResolve(String, AsyncCallback, Object) BeginResolve(String, AsyncCallback, Object) BeginResolve(String, AsyncCallback, Object) BeginResolve(String, AsyncCallback, Object)

Begins an asynchronous request to resolve a DNS host name or IP address to an IPAddress instance.

EndGetHostAddresses(IAsyncResult) EndGetHostAddresses(IAsyncResult) EndGetHostAddresses(IAsyncResult) EndGetHostAddresses(IAsyncResult)

Ends an asynchronous request for DNS information.

EndGetHostByName(IAsyncResult) EndGetHostByName(IAsyncResult) EndGetHostByName(IAsyncResult) EndGetHostByName(IAsyncResult)

Ends an asynchronous request for DNS information.

EndGetHostEntry(IAsyncResult) EndGetHostEntry(IAsyncResult) EndGetHostEntry(IAsyncResult) EndGetHostEntry(IAsyncResult)

Ends an asynchronous request for DNS information.

EndResolve(IAsyncResult) EndResolve(IAsyncResult) EndResolve(IAsyncResult) EndResolve(IAsyncResult)

Ends an asynchronous request for DNS information.

GetHostAddresses(String) GetHostAddresses(String) GetHostAddresses(String) GetHostAddresses(String)

Returns the Internet Protocol (IP) addresses for the specified host.

GetHostAddressesAsync(String) GetHostAddressesAsync(String) GetHostAddressesAsync(String) GetHostAddressesAsync(String)

Returns the Internet Protocol (IP) addresses for the specified host as an asynchronous operation.

GetHostByAddress(IPAddress) GetHostByAddress(IPAddress) GetHostByAddress(IPAddress) GetHostByAddress(IPAddress)

Creates an IPHostEntry instance from the specified IPAddress.

GetHostByAddress(String) GetHostByAddress(String) GetHostByAddress(String) GetHostByAddress(String)

Creates an IPHostEntry instance from an IP address.

GetHostByName(String) GetHostByName(String) GetHostByName(String) GetHostByName(String)

Gets the DNS information for the specified DNS host name.

GetHostEntry(IPAddress) GetHostEntry(IPAddress) GetHostEntry(IPAddress) GetHostEntry(IPAddress)

Resolves an IP address to an IPHostEntry instance.

GetHostEntry(String) GetHostEntry(String) GetHostEntry(String) GetHostEntry(String)

Resolves a host name or IP address to an IPHostEntry instance.

GetHostEntryAsync(IPAddress) GetHostEntryAsync(IPAddress) GetHostEntryAsync(IPAddress) GetHostEntryAsync(IPAddress)

Resolves an IP address to an IPHostEntry instance as an asynchronous operation.

GetHostEntryAsync(String) GetHostEntryAsync(String) GetHostEntryAsync(String) GetHostEntryAsync(String)

Resolves a host name or IP address to an IPHostEntry instance as an asynchronous operation.

GetHostName() GetHostName() GetHostName() GetHostName()

Gets the host name of the local computer.

Resolve(String) Resolve(String) Resolve(String) Resolve(String)

Resolves a DNS host name or IP address to an IPHostEntry instance.

Applies to