Sample code for 30+ languages & platforms
C#

DNS Lookup

Do a DNS lookup to resolve a hostname to an IP address.

Chilkat C# Downloads

C#
//  This example requires the Chilkat API to have been previously unlocked.
//  See Global Unlock Sample for sample code.

Chilkat.Socket socket = new Chilkat.Socket();

int maxWaitMs = 10000;
string ipAddr = socket.DnsLookup("www.chilkatsoft.com",maxWaitMs);
if (socket.LastMethodSuccess != true) {
    Debug.WriteLine(socket.LastErrorText);
    return;
}

Debug.WriteLine("IP Address: " + ipAddr);