If we need to translate a hostname(
for example:dotnetfunda.com ) to its IP Address,then we can use the classes as
Dns and IPAddress to do it.
using System.Net;
private static void Main(string[] args)
{
string website = "www.dotnetfunda.com";
IPAddress[] addresses = Dns.GetHostAddresses(website);
foreach (var address in addresses)
{
Console.Write(address);
}
Console.ReadLine();
}