#!/usr/bin/perl # Try to work out what the user is asking for # and consult the relevant whois server. # If they're asking for what looks like an # IP address or prefix, then look it up in # RIPE or ARIN's table as appropriate. # # These whois servers are correct as of 19th November 1999. $WHOIS = "/usr/bin/whois"; # Top level if ($ARGV[0] =~ /\.com$|\.org$|\.edu$|\.net$/) { exec ("$WHOIS $ARGV[0]\@whois.networksolutions.com"); } if ($ARGV[0] =~ /\.mil$/) { exec ("$WHOIS $ARGV[0]\@nic.ddn.mil"); } # UK commercial if ($ARGV[0] =~ /\.co\.uk$|\.org.uk$|\.net\.uk$|\.plc.uk$|\.gov\.uk$|\.net\.uk$/) { exec ("$WHOIS $ARGV[0]\@whois.nic.uk"); } # UK academic if ($ARGV[0] =~ /\.ac\.uk$/) { exec ("$WHOIS $ARGV[0]\@whois.ja.net"); } # France if ($ARGV[0] =~ /\.fr$/) { exec ("$WHOIS $ARGV[0]\@whois.nic.fr"); } # Germany if ($ARGV[0] =~ /\.de$/) { exec ("$WHOIS $ARGV[0]\@whois.nic.de"); } # Switzerland if ($ARGV[0] =~ /\.ch$/) { exec ("$WHOIS $ARGV[0]\@whois.nic.ch"); } # Pakistan if ($ARGV[0] =~ /\.pk$/) { exec ("$WHOIS $ARGV[0]\@whois.pknic.net.pk"); } # Singapore if ($ARGV[0] =~ /\.sg$/) { exec ("$WHOIS $ARGV[0]\@whois.nic.net.sg"); } # Korea if ($ARGV[0] =~ /\.kr$/) { exec ("$WHOIS $ARGV[0]\@whois.krnic.net"); } # Australia if ($ARGV[0] =~ /\.au$/) { exec ("$WHOIS $ARGV[0]\@whois.aunic.net"); } # Thailand if ($ARGV[0] =~ /\.th$/) { exec ("$WHOIS $ARGV[0]\@whois.thnic.net"); } # Taiwan if ($ARGV[0] =~ /\.tw$/) { exec ("$WHOIS $ARGV[0]\@whois.twnic.net"); } # Japan if ($ARGV[0] =~ /\.jp$/) { exec ("$WHOIS $ARGV[0]\@whois.nic.ad.jp"); } # Allocated to APNIC if ($ARGV[0] =~ /^202\.|^203\./) { exec ("$WHOIS $ARGV[0]\@whois.apnic.net"); } # Allocated to RIPE if ($ARGV[0] =~ /^193\.|^194\.|^195\.|^196\./) { exec ("$WHOIS $ARGV[0]\@whois.ripe.net"); } # Allocated to ARIN if ($ARGV[0] =~ /^[\d]{1,3}\.[\d]{1,3}\./) { exec ("$WHOIS $ARGV[0]\@whois.arin.net"); } # Try default server exec ("$WHOIS $ARGV[0]\@whois.internic.net");