man Net::Whois::Raw () - Get Whois information for domains

NAME

Net::Whois::Raw - Get Whois information for domains

SYNOPSIS

  use Net::Whois::Raw;

  $s = whois('perl.com');
  $s = whois('funet.fi');

  $arrayref = get_whois('yahoo.co.uk', undef, 'QRY_ALL');
  $text = get_whois('yahoo.co.uk', undef, 'QRY_LAST');
  ($text, $srv) = get_whois('yahoo.co.uk', undef, 'QRY_FIRST');

  ### if you do "use Net::Whois::Raw qw(
  #     $OMIT_MSG $CHECK_FAIL $CHECK_EXCEED
  #     $CACHE_DIR $CACHE_TIME $USE_CNAMES $TIMEOUT @SRC_IPS );
  ### you can use these:

  $OMIT_MSG = 1; # This will attempt to strip several known copyright
                messages and disclaimers sorted by servers.
                Default is to give the whole response.

  $OMIT_MSG = 2; # This will try some additional stripping rules
                if none are known for the spcific server.

  $CHECK_FAIL = 1; # This will return undef if the response matches
                one of the known patterns for a failed search,
                sorted by servers.
                Default is to give the textual response.

  $CHECK_FAIL = 2; # This will match against several more rules
                if none are known for the specific server.

  $CHECK_EXCEED = 1; # When this option is set, "die" will be called
                if connection rate to specific whois server have been
                exceeded

  $CACHE_DIR = "/var/spool/pwhois/"; # Whois information will be
                cached in this directory. Default is no cache.

  $CACHE_TIME = 24; # Cache files will be cleared after not accessed
                for a specific number of hours. Documents will not be
                cleared if they keep get requested for, independent
                of disk space. Default is not to clear the cache.

  $USE_CNAMES = 1; # Use whois-servers.net to get the whois server
                name when possible. Default is to use the 
                hardcoded defaults.

  $TIMEOUT = 10; # Cancel the request if connection is not made within
                a specific number of seconds.

  @SRC_IPS = (11.22.33.44); # List of local IP addresses to
                use for WHOIS queries. Addresses will be used used
                successively in the successive queries

DESCRIPTION

Net::Whois::Raw queries WHOIS servers about domains. The module supports recursive WHOIS queries.

Setting the variables CW$OMIT_MSG and CW$CHECK_FAIL will match the results against a set of known patterns. The first flag will try to omit the copyright message/disclaimer, the second will attempt to determine if the search failed and return undef in such a case.

IMPORTANT: these checks merely use pattern matching; they will work on several servers but certainly not on all of them.

FUNCTIONS

whois( DOMAIN [, SRV] )
Returns Whois information for CWDOMAIN. Without CWSRV argument default Whois server for specified domain name zone will be used. Caching is supported: if CW$CACHE_DIR variable is set and there is cached entry for that domain - information from the cache will be used.
get_whois( DOMAIN [, SRV [, WHICH_WHOIS]] )
Lower-level function to query Whois information for CWDOMAIN. Caching IS NOT supported (caching is implemented only in higher-level CWwhois function). Without CWSRV argument default Whois server for specified domain name zone will be used. CWWHICH_WHOIS argument is used to access a results if recursive queries; possible values: CW'QRY_FIRST' - returns results of the first query. Non't make recursive queries. In scalar context returns just whois text. In list context returns two values: whois text and whois server which was used to make query). CW'QRY_LAST' - returns results of the last query. In scalar context returns just whois text. In list context returns two values: whois text and whois server which was used to make query). This is the default option. CW'QRY_ALL' - returns results of the all queries of the recursive chain. Reference to array of references to hashes is returned. Hash keys: CWtext - result of whois query, CWsrv - whois server which was used to make query.

AUTHOR

Original author Ariel Brosh, schop@cpan.org, Inspired by jwhois.pl available on the net.

Since Ariel has passed away in September 2002:

Past maintainers Gabor Szabo, gabor@perl.org.il, Corris Randall corris@cpan.org

Current Maintainer: Walery Studennikov despair@cpan.org

CREDITS

Fixed regular expression to match hyphens. (Peter Chow, peter@interq.or.jp)

Added support for Tonga TLD. (.to) (Peter Chow, peter@interq.or.jp)

Added support for reverse lookup of IP addresses via the ARIN registry. (Alex Withers awithers@gonzaga.edu)

This will work now for RIPE addresses as well, according to a redirection from ARIN. (Philip Hands phil@uk.alcove.com, Trevor Peirce trev@digitalcon.ca)

Added the pattern matching switches, (Walery Studennikov despair@cpan.org)

Modified pattern matching, added cache. (Tony L. Svanstrom tony@svanstrom.org)

CHANGES

See file Changes in the distribution

NOTE

Some users complained that the die statements in the module make their CGI scripts crash. Please consult the entries on eval and die on perlfunc about exception handling in Perl.

COPYRIGHT

Copyright 2000-2002 Ariel Brosh. Copyright 2003-2003 Gabor Szabo. Copyright 2003-2003 Corris Randall. Copyright 2003-2004 Walery Studennikov.

This package is free software. You may redistribute it or modify it under the same terms as Perl itself.

I apologize for any misunderstandings caused by the lack of a clear licence in previous versions.

COMMERCIAL SUPPORT

Not available anymore.

LEGAL

Notice that registrars forbid querying their whois servers as a part of a search engine, or querying for a lot of domains by script. Also, omitting the copyright information (that was requested by users of this module) is forbidden by the registrars.

SEE ALSO

perl(1), Net::Whois, whois.