1Net::Whois::Raw(3)    User Contributed Perl Documentation   Net::Whois::Raw(3)
2
3
4

NAME

6       Net::Whois::Raw - Get Whois information of domains and IP addresses.
7

VERSION

9       version 2.99029
10

SYNOPSIS

12           use Net::Whois::Raw;
13
14           $dominfo = whois('perl.com');
15           ($dominfo, $whois_server) = whois('funet.fi');
16           $reginfo = whois('REGRU-REG-RIPN', 'whois.ripn.net');
17
18           $arrayref = get_whois('yahoo.co.uk', undef, 'QRY_ALL');
19           $text = get_whois('yahoo.co.uk', undef, 'QRY_LAST');
20           ($text, $srv) = get_whois('yahoo.co.uk', undef, 'QRY_FIRST');
21
22           $Net::Whois::Raw::OMIT_MSG = 1;
23               # This will attempt to strip several known copyright
24               # messages and disclaimers sorted by servers.
25               # Default is to give the whole response.
26
27           $Net::Whois::Raw::CHECK_FAIL = 1;
28               # This will return undef if the response matches
29               # one of the known patterns for a failed search,
30               # sorted by servers.
31               # Default is to give the textual response.
32
33           $Net::Whois::Raw::CHECK_EXCEED = 0 | 1 | 2;
34               # When this option is true, "die" will be called
35               # if connection rate to specific whois server have been
36               # exceeded.
37               # If set to 2, will die in recursive queries too.
38
39           $Net::Whois::Raw::CACHE_DIR = "/var/spool/pwhois/";
40               # Whois information will be
41               # cached in this directory. Default is no cache.
42
43           $Net::Whois::Raw::CACHE_TIME = 60;
44               # Cache files will be cleared after not accessed
45               # for a specific number of minutes. Documents will not be
46               # cleared if they keep get requested for, independent
47               # of disk space.
48
49           $Net::Whois::Raw::TIMEOUT = 10;
50               # Cancel the request if connection is not made within
51               # a specific number of seconds.
52
53           @Net::Whois::Raw::SRC_IPS = (11.22.33.44);
54               # List of local IP addresses to
55               # use for WHOIS queries. Addresses will be used used
56               # successively in the successive queries
57
58           $Net::Whois::Raw::POSTPROCESS{whois.crsnic.net} = \&my_func;
59               # Call to a user-defined subroutine on whois result,
60               # depending on whois-server.
61               # Above is equil to:
62               # ($text, $srv) = whois('example.com');
63               # $text = my_func($text) if $srv eq 'whois.crsnic.net';
64
65           $Net::Whois::Raw::QUERY_SUFFIX = '/e';
66               # This will add specified suffix to whois query.
67               # It may be used for english output forcing.
68

DESCRIPTION

70       Net::Whois::Raw queries WHOIS servers about domains.  The module
71       supports recursive WHOIS queries.  Also queries via HTTP is supported
72       for some TLDs.
73
74       Setting the variables $OMIT_MSG and $CHECK_FAIL will match the results
75       against a set of known patterns. The first flag will try to omit the
76       copyright message/disclaimer, the second will attempt to determine if
77       the search failed and return undef in such a case.
78
79       IMPORTANT: these checks merely use pattern matching; they will work on
80       several servers but certainly not on all of them.
81

NAME

83       Net::Whois::Raw — Get Whois information of domains and IP addresses.
84

FUNCTIONS

86       whois( DOMAIN [, SRV [, WHICH_WHOIS]] )
87          Returns Whois information for "DOMAIN" in punycode.  Without "SRV"
88          argument default Whois server for specified domain name zone will be
89          used. Use 'www_whois' as server name to force WHOIS querying via
90          HTTP (only few TLDs are supported in HTTP queries).  Caching is
91          supported: if $CACHE_DIR variable is set and there is cached entry
92          for that domain - information from the cache will be used.
93          "WHICH_WHOIS" argument - look get_whois docs below.
94
95       get_whois( DOMAIN [, SRV [, WHICH_WHOIS]] )
96          Lower-level function to query Whois information for "DOMAIN".
97          Caching IS NOT supported (caching is implemented only in higher-
98          level "whois" function).  Without "SRV" argument default Whois
99          server for specified domain name zone will be used.  "WHICH_WHOIS"
100          argument is used to access a results if recursive queries; possible
101          values:
102
103          'QRY_FIRST' -
104              returns results of the first query. Non't make recursive
105          queries.
106              In scalar context returns just whois text.
107              In list context returns two values: whois text and whois server
108              which was used to make query).
109
110          'QRY_LAST' -
111              returns results of the last query.
112              In scalar context returns just whois text.
113              In list context returns two values: whois text and whois server
114              which was used to make query).
115              This is the default option.
116
117          'QRY_ALL' -
118              returns results of the all queries of the recursive chain.
119              Reference to array of references to hashes is returned.
120              Hash keys: "text" - result of whois query, "srv" -
121              whois server which was used to make query.
122

USER DEFINED FUNCTIONS

124       whois_query_sockparams( DOMAIN, SRV )
125          You can set your own IO::Socket::INET params like this:
126
127              *Net::Whois::Raw::whois_query_sockparams = sub {
128                  my $class  = shift;
129                  my $domain = shift;
130                  my $name   = shift;
131
132                  return (
133                      PeerAddr => $name,
134                      PeerPort => 43,
135                      # LocalHost => ,
136                      # LocalPort =>
137                  );
138              };
139
140       whois_query_socket( DOMAIN, SRV )
141          You can set your own IO::Socket::INET like this:
142
143              *Net::Whois::Raw::whois_query_socket = sub {
144                  my $class  = shift;
145                  my $domain = shift;
146                  my $name   = shift;
147
148                  $name .= ':43';
149                  return IO::Socket::INET->new();
150              };
151
152       whois_query_ua( DOMAIN, SRV )
153          You can set your own LWP::UserAgent like this:
154
155              *Net::Whois::Raw::whois_query_ua = sub {
156                  my $class  = shift;
157                  my $domain = shift;
158
159                  return LWP::UserAgent->new();
160              };
161
162       set_ips_for_server('whois.ripn.net', ['127.0.0.1']);
163          You can specify IPs list which will be used for queries to desired
164          whois server.  It can be useful if you have few interfaces, but you
165          need to access whois server from specified ips.
166

AUTHOR

168       Original author Ariel Brosh schop@cpan.org, Inspired by jwhois.pl
169       available on the net.
170
171       Since Ariel has passed away in September 2002:
172
173       Past maintainers Gabor Szabo gabor@perl.org.il, Corris Randall
174       corris@cpan.org, Walery Studennikov despair@cpan.org
175
176       Current Maintainer: Alexander Nalobin nalobin@cpan.org
177

CREDITS

179       See file "Changes" in the distribution for the complete list of
180       contributors.
181

CHANGES

183       See file "Changes" in the distribution
184

NOTE

186       Some users complained that the die statements in the module make their
187       CGI scripts crash. Please consult the entries on eval and die on
188       perlfunc about exception handling in Perl.
189
191       Copyright 2000--2002 Ariel Brosh.  Copyright 2003--2003 Gabor Szabo.
192       Copyright 2003--2003 Corris Randall.  Copyright 2003--now() Walery
193       Studennikov
194
195       This package is free software. You may redistribute it or modify it
196       under the same terms as Perl itself.
197
198       I apologize for any misunderstandings caused by the lack of a clear
199       licence in previous versions.
200

COMMERCIAL SUPPORT

202       Not available anymore.
203
205       Notice that registrars forbid querying their whois servers as a part of
206       a search engine, or querying for a lot of domains by script.  Also,
207       omitting the copyright information (that was requested by users of this
208       module) is forbidden by the registrars.
209

SEE ALSO

211       pwhois, whois.
212

AUTHOR

214       Alexander Nalobin <alexander@nalobin.ru>
215
217       This software is copyright (c) 2002-2020 by Alexander Nalobin.
218
219       This is free software; you can redistribute it and/or modify it under
220       the same terms as the Perl 5 programming language system itself.
221
222
223
224perl v5.32.0                      2020-07-28                Net::Whois::Raw(3)
Impressum