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(
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. MICROSOFT.COM.ZZZZZZ.MORE.DETAILS.AT.WWW.BEYONDWHOIS.COM MICROSOFT.COM.ZZZZZ.GET.LAID.AT.WWW.SWINGINGCOMMUNITY.COM MICROSOFT.COM.ZZZZZ.DOWNLOAD.MOVIE.ONLINE.ZML2.COM MICROSOFT.COM.ZZZOMBIED.AND.HACKED.BY.WWW.WEB-HACK.COM MICROSOFT.COM.ZZZ.IS.0WNED.AND.HAX0RED.BY.SUB7.NET MICROSOFT.COM.WILL.LIVE.FOREVER.BECOUSE.UNIXSUCKS.COM MICROSOFT.COM.WILL.BE.SLAPPED.IN.THE.FACE.BY.MY.BLUE.VEINED.SPANNER.NET MICROSOFT.COM.WILL.BE.BEATEN.WITH.MY.SPANNER.NET MICROSOFT.COM.WAREZ.AT.TOPLIST.GULLI.COM MICROSOFT.COM.TOTALLY.SUCKS.S3U.NET MICROSOFT.COM.SOFTWARE.IS.NOT.USED.AT.REG.RU MICROSOFT.COM.SHOULD.GIVE.UP.BECAUSE.LINUXISGOD.COM MICROSOFT.COM.RAWKZ.MUH.WERLD.MENTALFLOSS.CA MICROSOFT.COM.OHMYGODITBURNS.COM MICROSOFT.COM.MORE.INFO.AT.WWW.BEYONDWHOIS.COM MICROSOFT.COM.LOVES.ME.KOSMAL.NET MICROSOFT.COM.LIVES.AT.SHAUNEWING.COM MICROSOFT.COM.IS.NOT.YEPPA.ORG MICROSOFT.COM.IS.NOT.HOSTED.BY.ACTIVEDOMAINDNS.NET MICROSOFT.COM.IS.IN.BED.WITH.CURTYV.COM MICROSOFT.COM.IS.HOSTED.ON.PROFITHOSTING.NET MICROSOFT.COM.IS.GOD.BECOUSE.UNIXSUCKS.COM MICROSOFT.COM.IS.A.STEAMING.HEAP.OF.FUCKING-BULLSHIT.NET MICROSOFT.COM.IS.A.MESS.TIMPORTER.CO.UK MICROSOFT.COM.HAS.ITS.OWN.CRACKLAB.COM MICROSOFT.COM.HAS.A.PRESENT.COMING.FROM.HUGHESMISSILES.COM MICROSOFT.COM.FILLS.ME.WITH.BELLIGERENCE.NET MICROSOFT.COM.CAN.GO.FUCK.ITSELF.AT.SECZY.COM Bye for now.