[thelist] TLD Zone File - Who is whois?

Anthony Baratta Anthony at Baratta.com
Tue Jul 10 11:30:32 CDT 2001


>My question is, how do I create my own whois search.  Is there a way to do
>this without indirectly using internics search box???
>
>Who holds all the whois data? Is it split up between all the registrars or
>is it in one central datasource?

The whois data is split into two parts. First you query the following 
InterNIC service at whois.crsnic.net. This will give you the following output:

[whois.crsnic.net]

Whois Server Version 1.3

Domain names in the .com, .net, and .org domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.

    Domain Name: BARATTA.COM
    Registrar: DOTSTER, INC.
    Whois Server: whois.dotster.com
    Referral URL: http://http://www.dotster.com/help/whois
    Name Server: NS.INREACH.NET
    Name Server: NS.BARATTA.COM
    Updated Date: 13-jun-2001


 >>> Last update of whois database: Tue, 10 Jul 2001 01:56:28 EDT <<<

The Registry database contains ONLY .COM, .NET, .ORG, .EDU domains and
Registrars.

Then you need to query the owning register's whois server for the contact 
information, in this case its whois.dotster.com.

Here is a perl script I use to do the multiple queries. The newest versions 
of Linux have BIND 9.x so the multiple queries are done for you via whois, 
but with older versions of Linux, this perl script works pretty good.

#!/usr/bin/perl

##
## eWhois, an extended Whois Program
##
## Version .9a

## CopyLeft KeyBoard Jockeys, 1999
## www.keyboardjockeys.com
## eWhois at keyboardjockeys.com

## Just give the address you want
## to ewhois on and if it exists in
## the whois.crsnic.net database,
## you'll be given the option to
## extend the search to the registry
## who holds the source of the whois info

## edit the $varWhoisExe for your server
## put in your /home/username/bin directory
## chmod to 755

## usage: ewhois foo.edu
##        ewhois foo.
##        ewhois foo

## Edit this variable for your whois program
## Note some linux versions alias whois for fwhois
         $varWhoisExe = "/usr/bin/fwhois";
#       $varWhoisExe = "/usr/bin/whois";

## Setting target of whois
         $varWhoisTarget = lc($ARGV[0]);

## If no arguments passed to program show help
         if ($varWhoisTarget) {
            print "Processing...\n\n";
            $varWhoisExe .= " " . $varWhoisTarget;
            $varWhoisResultOne = `$varWhoisExe\@whois.crsnic.net`;
            print $varWhoisResultOne;

            $varIndex = index(lc($varWhoisResultOne),"whois server:");
            if ($varIndex > -1) {
                 $varIndex1 = index(lc($varWhoisResultOne)," whois\.");
                 $varIndex2 = 
index(lc($varWhoisResultOne),"\.",($varIndex1+7));
                 $varLength = ($varIndex2 + 4) - $varIndex1;
                 $varWhoisServer = 
substr($varWhoisResultOne,$varIndex1+1,$varLen
gth);
                 chomp($varWhoisServer);
                 $varWhoisExe .= "\@" . $varWhoisServer;
                 print "Query " . $varWhoisServer . " for more info on " . 
$varWh
oisTarget . "? (y\/n) ";
                 chop($varAnswer=<STDIN>);
                 if (lc($varAnswer) eq "y") {
                    print "\nProcessing...\n\n";
                    $varWhoisResultTwo = `$varWhoisExe`;
                    print $varWhoisResultTwo;
                 }
            }
         } else {
            print "\nusage: ewhois domain.tld \n       ewhois 
domain.\n       ewh
ois domain\n";
         }
exit;

---
Anthony Baratta
President
Keyboard Jockeys

Blatant Plug: Cool Jazz for a hot summer,
     http://LisaMarie.Baratta.com





More information about the thelist mailing list