Get the IP address of a Host address using c#

Madhu.b.rokkam
Posted by Madhu.b.rokkam under C# category on | Points: 40 | Views : 3925
static void Main(string[] args)
{
string hostAddress = "www.DotnetFunda.com";
IPAddress[] allAddresses = Dns.GetHostAddresses(hostAddress);
foreach (IPAddress address in allAddresses)
{
Console.WriteLine("{0}", address);
}
Console.Read();
}

Comments or Responses

Login to post response