Using the Dns Class

The Internet Domain Name System (DNS) is the general system with which networking applications can retrieve information about specific hosts on a network, usually on the Internet. This information includes host names, domain names, and IP addresses. The Dns class that comes with the .NET framework is a static class. You do not need to instantiate anything before you use it; you can simply call the static methods that are a part of the class.

When the Dns methods return information, it is always in the form of an IPHostEntry object. For example, the following line gets host information based on a domain name:

IPHostEntry HostInfo = Dns.GetHostByName( “www.somedomain.com” ); 

The IPHostEntry object contains all the information ...

Get Special Edition Using® Microsoft® ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.