Querying WHOIS datbases int ASP.NET

A while back I was involved in developing a web site for a Domain and Hosting reseller. In that project I needed to create a “Find A Domain”  section in which the customer could check to see if a domain name exists.

I made a exhaustive research and figured out that each Who is server maintains a list of certain domain types. For example,  Whois.net can whois only .COM, .NET and .ORG domains.

Many posts over the internet, including blogs.msdn.com,  also says that to query a who is database one should connect to the whois server through a TCP/IP conenction (usually via port 43).

All the above issues make Whois action fairly difficult to perform. Luckily, today I came across a very nice web site which provides a Whois SOAP web service.  To see the details of the service check this link:


This web service searches all the who is databases to look up the domain name you provide. Therefore, you will not need to search several who is databases.

To Whois a domain name, you should pass a ‘hostname’ parameter to the service:


You can use this web service simply via a GET or a POST method as well as making a reference to it via Visual Studio and call its GetWhoIS metho. As I mentioned in the previous post (about REST web services), I prefer to get the who is answer using XElement.Load method. For example we may write the following method for whoising:

public static string WhoIs(string hostname)
XElement WhoisResult = XElement.Load(

return WhoisResult.ToString();

Each Who is server returns a different response. Therefore, to develop a method which indicates wheather a domain name exits or not, we should look for a common string value in the WhoIS response. For example the ‘NAME SERVER’ seems to be a common string. There fore, a domain lookup function can be written this way:

public static bool IsDomainTaken(string hostname)
return WhoIs(hostname).ToUpper().Contains(“NAME SERVER”);

As I told you, this web service seems to query several WhoIS server, thus the GetWhoIS method is a little bit time consuming.

P.S. Try to Whois Microsoft.com, the result is pretty funny:

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered

with many different competing registrars. Go to http://www.internic.net

for detailed information.





























Bye for now.


14 thoughts on “Querying WHOIS datbases int ASP.NET

  1. Your style is very unique in comparison to other people I have read stuff from.
    I appreciate you for posting when you have the opportunity, Guess I’ll just book mark this web site.

  2. If not, then just buy your friends and family their very own pair.

    There are many websites that offer them for free and you can easily find lots of them.
    Imagine this scenario: You are hanging out with a group
    of your friends, having a good time, and then oops.

  3. Thanks for your marvelous posting! I quite enjoyed reading it, you can be a great author.
    I will make certain to bookmark your blog and will eventually
    come back sometime soon. I want to encourage yourself
    to continue your great job, have a nice weekend!

  4. Thanks for your personal marvelous posting! I seriously enjoyed
    reading it, you are a great author. I will remember to bookmark your blog
    and will eventually come back later on. I want to encourage you to definitely continue your great posts, have a nice day!

  5. It’s been said that those with minimal computer experience are also
    able to sell on e – Bay, without any problems. and telling them
    the item has shipped and providing them with an estimate on once
    the package should arrive. A photo-realism close-up of a cows deal with, that on close examination you can appreciate is an incredibly skilled essential oil painting.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s