Dns.Resolve : Dns « System.Net « C# / C Sharp by API






Dns.Resolve

 

using System;
using System.Net;

class MainClass
{
   public static void Main(string[] argv)
   {
      IPHostEntry iphe = Dns.Resolve("62.208.12.1");

      Console.WriteLine("Host name: {0}", iphe.HostName);
      foreach(string alias in iphe.Aliases)
      {
         Console.WriteLine("Alias: {0}", alias);
      }
      foreach(IPAddress address in iphe.AddressList)
      {
         Console.WriteLine("Address: {0}",
                     address.ToString());
      }
   }
}

   
  








Related examples in the same category

1.Dns.EndResolve(IAsyncResult ar)
2.Dns.GetHostByAddress(IPAddress ip)
3.Dns.GetHostByName
4.Dns.GetHostEntry(String value)
5.Dns.GetHostName()