Get Resolve Info : DNS : Network C# Source Code


Custom Search

C# Source Code » Network » DNS »

 

Get Resolve Info









    


using System;
using System.Net;

public class GetResolveInfo
{
   public static void Main(string[] argv)
   {
      if (argv.Length != 1)
      {
         Console.WriteLine("Usage: GetResolveInfo address");
         return;
      }

      IPHostEntry iphe = Dns.Resolve(argv[0]);

      Console.WriteLine("Information for {0}", argv[0]);

      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());
      }
   }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Network
» DNS