ActivePerl Documentation
|
NAMENet::Whois - Get and parse ``whois'' domain data from InterNIC
SUPPORTED PLATFORMS
SYNOPSISNote that all fields except ``name'' and ``tag'' may be undef because ``whois'' information is erratically filled in. use Net::Whois; use Carp; my $w = new Net::Whois::Domain $dom or die "Can't connect to Whois server\n;
unless ($w->ok) { croak "No match for $dom";}
print "Domain: ", $w->domain, "\n";
print "Name: ", $w->name, "\n";
print "Tag: ", $w->tag, "\n";
print "Address:\n", map { " $_\n" } $w->address;
print "Country: ", $w->country, "\n";
print "Name Servers:\n", map { " $$_[0] ($$_[1])\n" }
@{$w->servers};
my ($c, $t);
if ($c = $w->contacts) {
print "Contacts:\n";
for $t (sort keys %$c) {
print " $t:\n";
print map { "\t$_\n" } @{$$c{$t}};
}
}
print "Record created:", $w->record_created ;
print "Record updated:", $w->record_updated ;
DESCRIPTIONNet::Whois::Domain Note that the Locale::Country module (part of the Locale-Codes distribution) is used to recognize spelled-out country names; if that module is not present, only two-letter country abbreviations will be recognized. The server consulted is ``whois.internic.net''. You can only get .org, .edu, .net, .com domains from Internic. Other whois servers for other Top-Level-Domains (TLD) return information in a different syntax and are not supported at this time. Also, only queries for domains are valid. Querying for a network will fail utterly since those are not kept in the whois.internic.net server (a future enhancement will add a network lookup function). Querying for NIC handles won't work since they have a different return syntax than a domain. Domains other than those listed won't work they're not in the server. A future enhancment planned will send the query to the appropriate server based on its TLD.
AUTHOROriginally written by Chip Salzenberg (chip@pobox.com) in April of 1997 for Idle Communications, Inc. In September of 1998 Dana Hudes (dhudes@hudes.org) found this but it was broken and he needed it so he fixed it. In August, 1999 Dana and Chip agreed to become co-maintainers of the module. Dana released a new version of Net::Whois to CPAN and resumed active development.
COPYRIGHTThis module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. If you make modifications, the author would like to know so that they can be incorporated into future releases.
|