Upraviť

Zdieľať cez


Dns Class

Definition

Provides simple domain name resolution functionality.

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

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)

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

BeginGetHostByName(String, AsyncCallback, Object)
Obsolete.
Obsolete.
Obsolete.

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

BeginGetHostEntry(IPAddress, AsyncCallback, Object)

Asynchronously resolves an IP address to an IPHostEntry instance.

BeginGetHostEntry(String, AsyncCallback, Object)

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

BeginResolve(String, AsyncCallback, Object)
Obsolete.
Obsolete.
Obsolete.

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

EndGetHostAddresses(IAsyncResult)

Ends an asynchronous request for DNS information.

EndGetHostByName(IAsyncResult)
Obsolete.
Obsolete.
Obsolete.

Ends an asynchronous request for DNS information.

EndGetHostEntry(IAsyncResult)

Ends an asynchronous request for DNS information.

EndResolve(IAsyncResult)
Obsolete.
Obsolete.
Obsolete.

Ends an asynchronous request for DNS information.

GetHostAddresses(String, AddressFamily)

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

GetHostAddresses(String)

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

GetHostAddressesAsync(String, AddressFamily, CancellationToken)

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

GetHostAddressesAsync(String, CancellationToken)

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

GetHostAddressesAsync(String)

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

GetHostByAddress(IPAddress)
Obsolete.
Obsolete.
Obsolete.

Creates an IPHostEntry instance from the specified IPAddress.

GetHostByAddress(String)
Obsolete.
Obsolete.
Obsolete.

Creates an IPHostEntry instance from an IP address.

GetHostByName(String)
Obsolete.
Obsolete.
Obsolete.

Gets the DNS information for the specified DNS host name.

GetHostEntry(IPAddress)

Resolves an IP address to an IPHostEntry instance.

GetHostEntry(String, AddressFamily)

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

GetHostEntry(String)

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

GetHostEntryAsync(IPAddress)

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

GetHostEntryAsync(String, AddressFamily, CancellationToken)

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

GetHostEntryAsync(String, CancellationToken)

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

GetHostEntryAsync(String)

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

GetHostName()

Gets the host name of the local computer.

Resolve(String)
Obsolete.
Obsolete.
Obsolete.

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

Applies to