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.
private static void Main(string args)
string website = "www.dotnetfunda.com";
IPAddress addresses = Dns.GetHostAddresses(website);
foreach (var address in addresses)