DNS Name Resolution

image_pdfimage_print
   

using System;
using System.Net;

public class DNSNameResolution
{
  [STAThread]
  static void Main(string[] args)
  {
    IPHostEntry MyHost = Dns.Resolve(args[0]);

    foreach (IPAddress MyIP in MyHost.AddressList)
    {
      Console.WriteLine(MyIP.Address);
    }
  }
}

           
          


This entry was posted in C# Network. Bookmark the permalink.