Networking System [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.x.x 1.0.5000.0 2.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object

Obtains domain information from the Domain Name System as defined by IETF RFC 1035 and RFC 1036.

The class creates and sends queries to obtain information about a host server from the Internet Domain Name System (DNS). In order to access DNS, the machine executing the query is required to be connected to a network. If the query is executed on a machine that does not have access to a domain name server, a is thrown.

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

See the class page for an example that uses the class.

- Method
  2.0.0.0
  System.IAsyncResult `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  System.IAsyncResult `` `` `` A containing the DNS name of the host. A delegate, or . An application-defined object, or .

  Begins the asynchronous execution of a DNS query to obtain address information about the specified host.

  A instance that contains information about the asynchronous operation.

  This method starts an asynchronous request for information about the specified host. To retrieve the results of the query and release resources allocated by this method, call the method and specify the object returned by this method. The method should be called exactly once for each call to .

  If the parameter is not , the method referenced by is invoked when the asynchronous operation completes. The object returned by this method is passed as the argument to the method referenced by . The method referenced by can retrieve the results of the query by calling .

  The parameter can be any object that the caller wishes to have available for the duration of the asynchronous operation. This object is available via the property of the object returned by this method. is . An error was encountered executing the DNS query . The caller does not have permission to access DNS information. Requires unrestricted permission for accessing DNS information. See and . 0 1.0.5000.0 2.0.0.0 System.Obsolete("Use BeginGetHostEntry instead")
- Method
  2.0.0.0
  System.IAsyncResult `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  System.IAsyncResult `` `` `` To be added. To be added. To be added. To be added. To be added. To be added.
- Method
  System.IAsyncResult `` `` `` A containing the DNS name or IP address of the host. A delegate or . An application-defined object, or .

  Begins the asynchronous execution of a DNS query to resolve a host name or IP address.

  A instance that contains information about the asynchronous operation.

  This method starts an asynchronous request for DNS information about the specified host. To retrieve the results of the query and release resources allocated by this method, call the method, and specify the object returned by this method. The method should be called exactly once for each call to .

  If the parameter is not , the method referenced by is invoked when the asynchronous operation completes. The object returned by this method is passed as the argument to the method referenced by . The method referenced by can retrieve the results of the query by calling .

  The parameter can be any object that the caller wishes to have available for the duration of the asynchronous operation. This object is available via the property of the object returned by this method.

  is . An error was encountered executing the DNS query . The caller does not have permission to access DNS information. Requires unrestricted permission for accessing DNS information. See and . 0 1.0.5000.0 2.0.0.0 System.Obsolete("Use BeginGetHostEntry instead")
- Method
  2.0.0.0
  System.Net.IPAddress[] `` To be added. To be added. To be added. To be added.
- Method
  System.Net.IPHostEntry `` The object that holds the state information for the asynchronous operation.

  Ends an asynchronous query to obtain address information about the specified host.

  A object containing DNS address information about a host.

  This method blocks if the asynchronous operation has not completed.

  The method completes an asynchronous request for DNS information that was started with a call to . The object specified for the parameter is required to be the same object as was returned by the method call that began the request.

  If the method is invoked via the delegate specified to the method, the parameter is the argument passed to the delegate's method.

  is . 0 1.0.5000.0 2.0.0.0 System.Obsolete("Use EndGetHostEntry instead")
- Method
  2.0.0.0
  System.Net.IPHostEntry `` To be added. To be added. To be added. To be added.
- Method
  System.Net.IPHostEntry `` The object that holds the state information for the asynchronous operation.

  Ends an asynchronous query to resolve a host name or IP address.

  A object containing address information about a host.

  This method blocks if the asynchronous operation has not completed.

  The method completes an asynchronous request for DNS information that was started with a call to . The object specified for the parameter is required to be the same object as was returned by the method call that began the request.

  If the method is invoked via the delegate specified to the method, the parameter is the argument passed to the delegate's method.

  is . 0 1.0.5000.0 2.0.0.0 System.Obsolete("Use EndGetHostEntry instead")
- Method
  2.0.0.0
  System.Net.IPAddress[] `` To be added. To be added. To be added. To be added.
- Method
  System.Net.IPHostEntry `` A instance.

  Queries DNS for the DNS host name of the specified IP address.

  A instance containing the host information.

  To be added. is . An error was encountered executing the DNS query . The caller does not have permission to access DNS information. Requires unrestricted permission for accessing DNS information. See and . 0 1.0.5000.0 2.0.0.0 System.Obsolete("Use GetHostEntry instead")
- Method
  System.Net.IPHostEntry `` A containing an IP address.

  Queries DNS for the DNS host name of the specified IP address.

  A instance containing the host information.

  The IP address specified by the parameter is required to be in dotted-quad notation (for example, "192.168.1.2").

  is . is not a valid IP address. An error was encountered executing the DNS query . The caller does not have permission to access DNS information. Requires unrestricted permission for accessing DNS information. See and . 0 1.0.5000.0 2.0.0.0 System.Obsolete("Use GetHostEntry instead")
- Method
  System.Net.IPHostEntry `` A containing the DNS name of the host.

  Queries DNS for address information about the specified host.

  A object containing host information for the address specified in .

  To retrieve host information asynchronously, use the and methods.

  See the class page for an example that uses the method.

  is . An error was encountered executing the DNS query . The caller does not have permission to access DNS information. Requires unrestricted permission for accessing DNS information. See and . 0 1.0.5000.0 2.0.0.0 System.Obsolete("Use GetHostEntry instead")
- Method
  2.0.0.0
  System.Net.IPHostEntry `` To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  System.Net.IPHostEntry `` To be added. To be added. To be added. To be added.
- Method
  System.String

  Gets the DNS host name of the local machine.

  A containing the DNS host name of the local machine.

  To be added. An error was encountered resolving the local host name. The caller does not have permission to access DNS information. Requires unrestricted permission for accessing DNS information. See and . 0 1.0.5000.0 2.0.0.0
- Method
  System.Net.IPHostEntry `` A containing a DNS-style host name or IP address.

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

  A instance containing address information about the host specified in .

  The method queries a DNS server for the IP address associated with a host name or an IP address in dotted-quad notation.

  When is a DNS-style host name associated with multiple IP addresses, only the first IP address that resolves to that host name is returned.

  is . An error was encountered executing the DNS query . The caller does not have permission to access DNS information. Requires unrestricted permission for accessing DNS information. This method also asserts unrestricted . See and .

  The following example demonstrates the use of the method.

  `using System; using System.Net; public class DnsTest { public static void Main() { IPHostEntry hostInfo1 = Dns.Resolve("www.contoso.com"); DisplayHostInfo(hostInfo1); Console.WriteLine(); } public static void DisplayHostInfo(IPHostEntry hostInfo) { string[] aliases = hostInfo.Aliases; IPAddress[] addresses = hostInfo.AddressList; Console.WriteLine("The host name is: {0}", hostInfo.HostName); for(int x = 0; x < aliases.Length; x++) Console.WriteLine("Alias {0} == {1}", aliases[x], addresses[x]); } }`

  The output is

  The host name is: contoso.com

  Alias www.contoso.com == 207.46.230.186

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete("Use GetHostEntry instead")
0