#!/usr/bin/perl # whois2 - Recursive whois client. # Copyright (C) 1999 Tom Rothamel # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. use IO::Socket; sub whoisit { my $server = shift; my $domain = shift; my $whois; print "[$server]\n"; my $scon = new IO::Socket::INET(PeerAddr => $server, PeerPort => 'whois', Proto => 'tcp'); unless ($scon) { print "Couldn't connect to whois server. Sorry.\n"; return; } print $scon $domain, "\r\n"; while (<$scon>) { print; if (/Whois Server: (.*)$/) { $whois = $1; } } return $whois; } # End common code. if ($ARGV[0] eq '-h' || $ARGV[0] eq '--help' || ! $ARGV[0]) { print < for Computerworks of Northport (http://www.computerworks.net/), who later gave permission for its global release. =head1 WEB SITE The whois2 web site is located at http://onegeek.org/~tom/software/whois2/ =head1 SEE ALSO L =cut