Provides simple domain name resolution functionality.
Public NotInheritable Class Dns
You do not need to declare an instance of a static class in order to access its members.
public static class Dns
public ref class Dns abstract sealed
public final class Dns
The Dns class is a static class that retrieves information about a specific host from the Internet Domain Name System (DNS).
The host information from the DNS query is returned in an instance of the IPHostEntry class. If the specified host has more than one entry in the DNS database, IPHostEntry contains multiple IP addresses and aliases.
The following example queries the DNS database for information on the host www.contoso.com.
Dim hostInfo As IPHostEntry = Dns.GetHostByName("www.contoso.com")
IPHostEntry hostInfo = Dns.GetHostByName("www.contoso.com");
IPHostEntry^ hostInfo = Dns::GetHostByName( "www.contoso.com" );
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC