tags:

views:

720

answers:

2

How do you resolve a domain name to an IP address with .NET/C#?

+6  A: 
                    using System.Net;

foreach (IPAddress address in Dns.GetHostAddresses("www.google.com"))
{
Console.WriteLine(address.ToString());
}
lubos hasko
A: 

Try using the System.Net.Dns class

Yaakov Ellis