This tutorial will show you how to resolved hosting information by typing in the DNS name using ASP.NET 2.0 and VB 2.0. This tutorial will show you how to resolved hosting information by typing in the DNS name using ASP.NET 2.0 and VB.NET.

First, you will need to import the System.Net namespace. The System.Net namespace provides a simple programming interface for many of the protocols used on networks today. The namespace contains the Classes IPHostEntry , IPAddress and DNS. The DNSclass 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 IPAddress class contains the address of a computer on an IP network. The IPHostEntry class associates a Domain Name System (DNS) host name with an array of aliases and an array of matching IP addresses.The IPHostEntry class is used as a helper class with the DNS class.

We use the btnResolve_Click event to do the work. We then call the Dns.Resolve to resolve the hosting information using the variables from our ASP.NET coded page

The front end .aspx page looks something like this:
[html]

DnsLookup



Results


[/vb]
The flow for the code behind page is as follows.

Download Source Files