[lug] What does this Whois Entry mean

Warren Sanders sanders at MontanaLinux.Org
Sun Jul 1 08:52:13 MDT 2001


On Sat, 30 Jun 2001, dan radom wrote:

> Date: Sat, 30 Jun 2001 00:59:56 -0600
> From: dan radom <dradom at redback.com>
> Reply-To: lug at lug.boulder.co.us
> To: lug at lug.boulder.co.us
> Subject: Re: [lug] What does this Whois Entry mean
>
> I didn't much care for the whois results change, so i replaced whois and still get the old results.
>
> #!/bin/sh
> if test -x $1
> then
>         echo "example usage: whois radom.org"
>         exit 1
> else
>         whois $1 at whois.networksolutions.com
> fi
>
>
>
> * Todd (lasten at korinth.com) wrote:
> > Current command line whois gives you smaller amounts of info then it used to
> > due to changes made to the netsol database output back awhile ago.  I have
> > no played with it much to see if I can get the info query to change but it
> > caused me a lot of trouble when it happened:)
> >
> > -tn
> >
> > ----- Original Message -----
> > From: "John Hernandez" <John.Hernandez at noaa.gov>
> > To: <lug at lug.boulder.co.us>
> > Sent: Friday, June 29, 2001 11:41 AM
> > Subject: Re: [lug] What does this Whois Entry mean
> >
> >
> > > I don't think it's a root name server.  You may not have queried the
> > correct whois server.
> > >
> > > >From whois.networksolutions.com:
> > >
> > > Registrant:
> > > Southern New England Telecommunications (SNET2-DOM)
> > >    27 Butler Street
> > >    Meriden, CT 06451-4101
> > >    US
> > >
> > >    Domain Name: SNET.NET
> > >
> > >    Administrative Contact, Technical Contact:
> > >       Devetzis, Taso N  (TND)  devetzis at SNET.NET
> > >       SNET Information and Entertainment Services
> > >       2nd Floor
> > >       545 Long Wharf Drive
> > >       New Haven, CT 06510
> > >       +1 203 771 8917 (FAX) +1 203 771 2008
> > >    Billing Contact:
> > >       Wooten, Karen  (KW679)  kwooten at SNET.NET
> > >       SNET
> > >       27 Butler Street
> > >       Meriden, CT 06451-4101
> > >       +1 203 630 5800
> > >
> > >    Record last updated on 30-Jun-2000.
> > >    Record expires on 07-Jul-2001.
> > >    Record created on 06-Jul-1994.
> > >    Database last updated on 29-Jun-2001 00:10:00 EDT.
> > >
> > >    Domain servers in listed order:
> > >
> > >    NS1.SNET.NET                 204.60.0.2
> > >    NS2.SNET.NET                 204.60.0.3
> > > --
> > >
> > >   - John Hernandez - Network Engineer - 303-497-6392 -
> > >  |  National Oceanic and Atmospheric Administration   |
> > >  |  Mailstop R/OM12. 325 Broadway, Boulder, CO 80305  |
> > >   ----------------------------------------------------
> > > _______________________________________________
> > > Web Page:  http://lug.boulder.co.us
> > > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > >
> >
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>

************************************************************************

For my results I submitted identical to this above I added this "nwhois"
to my home /bin:

<snip>

#!/usr/bin/perl5 -w
#
# BW whois
#
# Copyright (c) 1999 William E. Weinman
# http://bw.org/
#
# Designed to work with the new-mangled whois system introduced 1 Dec
1999.
#
# Under the new domain-name regime the whois system is now distributed
# amongst the various domain-police^H^H^H^H^H^H^H^H^H^H registrars,
thereby
# requiring that we make at least two separate requests (to two separate

# servers) for each whois record.
#
# This program will first go to the "root" whois server and ask for a
record.
# If found, the root server will tell us where to go get the actual
record, and
# then we go get it.
#
# Additional feature: If this program gets back a list of references
instead
# of a single record (as in the case of a record with a domain name for
an
# organization name), it will go out one more time and fetch the actual
# record using the bang-handle. This became necessary because the "root"

# whois server doesn't know where to tell you to go for a handle. Messy.

#
# This program is free software. You may modify and distribute it under
# the same terms as perl itself.
#
# version 1.0 -- wew 2 Dec 1999  -- first release
# version 1.1 -- wew 3 Dec 1999
#                   added --stripheader (by popular demand)
#                   thanks to Bill Shupp <hostmaster at shupp.org> for the
concept.
#                   also -- now prints "Registrar: <host>" line (unless
quiet)
# version 1.2 -- wew 3 Dec 1999
#                   added new syntax for specifying a host. can now say:

#                      whois <request>@<host>   as a synonym for:
#                      whois -h <host> <request>
#                   thanks to Rob Friedman <playerx_ at hotmail.com> for
suggesting
#                   this feature.
#

use strict;
use vars qw( $host $quiet $stripheader );
use IO::Socket;
use Getopt::Long;

$host = '';
$quiet = '1';
$stripheader = '1';

my $banner  = "whois 1.2 by Bill Weinman <http://bw.org/>\n";
my $banner2 = "works with the new-mangled whois system introduced 1 Dec
1999\n";

my $HEADERBOT = q{you agree to abide by this policy};

use constant TRUE      => 1;
use constant FALSE     => '';

my $default_host = 'whois.internic.net';    # starting point
my $portname = 'whois(43)';
my $protoname = 'tcp';

GetOptions(
             "host=s" => \$host,
             "stripheader!" => \$stripheader,
             "quiet!" => \$quiet
           ) or usage();

my $domain = shift or usage();

# support for the <request>@<domain> syntax ...
unless ($host) { ($domain, $host) = split /\@/, $domain; }

my @rc = ();
my $subrec = '';

# signon
print $banner unless $quiet;

# first: Go Fishin' at the InterNIC ...
unless($host) {
  @rc = whois_fetch($default_host, $domain);
  grep { /Whois Server:\s*(.*)/i and $host = $1 } @rc;
  print "Not found: $domain.\n" unless $host;
  }

# now we know where to look -- let's go get it
if($host) {
  @rc = whois_fetch($host, $domain);
  grep {/\((.*-DOM)\).*$domain$/i and $subrec = $1 } @rc;
  }

# do we have a sub rec? If so, "Fetch!"
if($subrec) {
  print "found a reference to $subrec ... requesting full record ...\n"
unless $quiet;
  @rc = whois_fetch($host, $subrec);
  }

# tell 'em what we found ...
print "Registrar: $host\n" if (@rc && $host && !$quiet);
my $headerflag = ($stripheader && $host =~ /networksolutions.com$/) ?
TRUE : FALSE;
while(@rc) {
  my $l = shift @rc;
  print $l unless $stripheader && $headerflag;
  if($stripheader) {
    $headerflag = FALSE if($l =~ /$HEADERBOT/i);
    }
  }

sub whois_fetch
{
my $host = shift;
my $domain = shift;
my @rc;

my $rs = IO::Socket::INET->new(
    PeerAddr  => $host,
    PeerPort  => $portname,
    Proto     => $protoname
  ) or die "$host not found\n";
my $IP = $rs->peerhost;
print "connecting to $host [$IP] ... \n" unless $quiet;
$rs->autoflush(1);

$rs->print("$domain\n");
while(<$rs>) {
  push @rc, $_;
  }
return @rc;
}

sub usage
{
print $banner, $banner2;
print <<USAGE;

usage: whois [options] <request>
   or: whois [options] <request>@<host>

options:

  --host <host>  Hostname of the whois server
  -h <host>      this is the same as the <request>@<host> form
                 if not specified will search $default_host
                 for a "Whois Server:" record

  --quiet        Don't print any extraneous messages.
  -q             ... "just the facts, ma'am"

  --stripheader  Strip off that silly disclaimer from the
  -s             whois.networksolutions.com server. You've
                 read it a thousand times already, right?

USAGE
exit;
}

<snip>
This needs to be executable.  Sorry about the wordwrap, you probably need
to adjust that too.
-- 
Warren Sanders
http://MontanaLinux.Org




More information about the LUG mailing list