Dns Dns Dns Dns Class

定义

提供简单的域名解析功能。Provides simple domain name resolution functionality.

public ref class Dns abstract sealed
public static class Dns
type Dns = class
Public Class Dns
继承

示例

下面的示例在 DNS 数据库中查询有关主机www.contoso.com的信息。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")

注解

Dns类是一个静态类, 用于从 Internet 域名系统 (DNS) 检索有关特定主机的信息。The Dns class is a static class that retrieves information about a specific host from the Internet Domain Name System (DNS).

来自 DNS 查询的主机信息将在IPHostEntry类的实例中返回。The host information from the DNS query is returned in an instance of the IPHostEntry class. 如果指定的主机在 DNS 数据库中有多个条目, IPHostEntry则包含多个 IP 地址和别名。If the specified host has more than one entry in the DNS database, IPHostEntry contains multiple IP addresses and aliases.

方法

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

异步返回指定主机的 Internet 协议 (IP) 地址。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)

开始异步请求关于指定 DNS 主机名的 IPHostEntry 信息。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)

将 IP 地址异步解析为 IPHostEntry 实例。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)

将主机名或 IP 地址异步解析为 IPHostEntry 实例。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)

开始异步请求将 DNS 主机名或 IP 地址解析为 IPAddress 实例。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)

结束对 DNS 信息的异步请求。Ends an asynchronous request for DNS information.

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

结束对 DNS 信息的异步请求。Ends an asynchronous request for DNS information.

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

结束对 DNS 信息的异步请求。Ends an asynchronous request for DNS information.

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

结束对 DNS 信息的异步请求。Ends an asynchronous request for DNS information.

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

返回指定主机的 Internet 协议 (IP) 地址。Returns the Internet Protocol (IP) addresses for the specified host.

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

返回指定主机的 Internet 协议 (IP) 地址以作为异步操作。Returns the Internet Protocol (IP) addresses for the specified host as an asynchronous operation.

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

根据指定的 IPAddress 创建 IPHostEntry 实例。Creates an IPHostEntry instance from the specified IPAddress.

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

根据 IP 地址创建 IPHostEntry 实例。Creates an IPHostEntry instance from an IP address.

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

获取指定 DNS 主机名的 DNS 信息。Gets the DNS information for the specified DNS host name.

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

将 IP 地址解析为 IPHostEntry 实例。Resolves an IP address to an IPHostEntry instance.

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

将主机名或 IP 地址解析为 IPHostEntry 实例。Resolves a host name or IP address to an IPHostEntry instance.

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

将 IP 地址解析为 IPHostEntry 实例以作为异步操作。Resolves an IP address to an IPHostEntry instance as an asynchronous operation.

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

将主机名或 IP 地址解析为 IPHostEntry 实例以作为异步操作。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)

将 DNS 主机名或 IP 地址解析为 IPHostEntry 实例。Resolves a DNS host name or IP address to an IPHostEntry instance.

适用于