User Tip #163: Do it yourself WHOIS command

Hits: Failed to execute CGI : Win32 Error Code = 3


If you have your own web site with a registered name, you should be familiar with the WHOIS utility. You can search by web address, NIC handle, or ip address. whois is available as a commandline utility in unix. There are also web versions:

Although NT does not come with whois, you can create your own version using a batch file:

contents of WHOIS.cmd:

@echo off
start http://www.networksolutions.com/cgi-bin/mcwho/whois?STRING=%1

-or-

@echo off
start http://www.whois.net/search.cgi2?str=%1

The first version uses the whois lookup from Networksolutions whereas the second version uses the whois lookup from Whois.net Copy the batch file to somewhere in your path, for example, the %systemroot%\system32 folder. Because I have a lot of these small scripts and batch files, I created a %systemroot%\bin folder and placed it in the path. To lookup the whois info for microsoft.com, use the commandline:

whois microsoft.com

The results are:


Registrant:
Microsoft Corporation (MICROSOFT-DOM)
   1 microsoft way
   redmond, WA 98052
   US

   Domain Name: MICROSOFT.COM

   Administrative Contact:
      Microsoft Hostmaster  (MH37-ORG)  
      Microsoft Corp
      One Microsoft Way
      Redmond, WA 98052
      US
      425 882 8080
      Fax- - - .: 206 703 2641
   Technical Contact:
      MSN NOC  (MN5-ORG)  
      Microsoft Corp
      One Microsoft Way
      Redmond, WA 98052
      US
      425 882 8080
      Fax- PATH
   Billing Contact:
      idNames, Accounting  (IA90-ORG)  
      idNames from Network Solutions, Inc
      440 Benmar
      Suite #3325
      Houston, TX 77060
      US
      703-742-4777
      Fax 281-447-1160

   Record last updated on 19-Mar-2001.
   Record expires on 03-May-2010.
   Record created on 02-May-1991.
   Database last updated on 23-Apr-2001 10:05:00 EDT.

   Domain servers in listed order:

   DNS4.CP.MSFT.NET             207.46.138.11
   DNS5.CP.MSFT.NET             207.46.138.12
   DNS2.TK.MSFT.NET             207.46.232.38
   DNS1.TK.MSFT.NET             207.46.232.37
   DNS3.UK.MSFT.NET             



Tim Hill's text on command line scripting is outstanding. If you have an extensive background, writing bat files, forget it. Otherwise, get it.



Windows scripting host is a different animal entirely to batchfile-like scripts. Much more powerful. Native scripting language for NT2000 but available for NT4. Start studying now. Includes builtin support for vbscript & jscript with addins available for perl and other scripting languages. Extraordinary powerful and subsequently it can be very complex.