How do you resolve a domain name to an IP address with .NET/C#?
Asked
Active
Viewed 6,465 times
2 Answers
20
using System.Net;
foreach (IPAddress address in Dns.GetHostAddresses("www.google.com"))
{
Console.WriteLine(address.ToString());
}

Richard J. Ross III
- 55,009
- 24
- 135
- 201

lubos hasko
- 24,752
- 10
- 56
- 61