Net-Whois-Raw-2.43000755000000000000 012014617173 14337 5ustar00unknownunknown000000000000Net-Whois-Raw-2.43/Build.PL000444000000000000 150312014615151 15761 0ustar00unknownunknown000000000000#!/usr/bin/perl -w use strict; use Module::Build; my $requires = { 'perl' => '5.008001', 'Getopt::Long' => 2.0, 'URI::URL' => 0, 'LWP::UserAgent' => 0, 'HTTP::Request' => 0, 'HTTP::Headers' => 0, 'Test::More' => 0, 'Encode' => 0, 'Net::IDN::Punycode' => 1, }; if ($^O =~ /Win/) { $requires->{'Win32API::Registry'} = 0; } my $build = Module::Build->new( module_name => 'Net::Whois::Raw', license => 'perl', requires => $requires, script_files => 'pwhois', dist_abstract => 'Get Whois information for domains', ); $build->create_build_script; # IS IT NECESSARY? (see belowe) # #sub MY::postamble { # package MY; # shift->SUPER::postamble . <<'MAKE'; #dist : README # #README : lib/Net/Whois/Raw.pm # @$(PERL) -MPod::Text -e "pod2text('$<');" > $@ # #MAKE #} Net-Whois-Raw-2.43/Changes000444000000000000 3652012014616000 16001 0ustar00unknownunknown000000000000Revision history for Perl module Net::Whois::Raw. 0.01 Jul 05 2000 - original version; created by h2xs 1.19 0.23 Mar 25 2003 - only exports &whois by default, the other variables are exportable still. - incorporated new whois servers ( thanks Toni Mueller ) - now tests the main tlds - added some more regexen to strip out disclaimers and such ( for $OMIT_MSG > 2 ). - moved %servers to %Net::Whois::Raw::Data::servers 0.24 Nov 18 2003 Walery Studennikov - fixed whois server for .org domains and add new whois servers for multilingual domains - fixed recursive whois requests for .org domains - new fail-check and strip patterns added - more verbose error messages - added support for third level domains - some bugfixes 0.25 Nov 21 2003 Walery Studennikov - fixed multilingual domains whois via whois.melbourneit.com server - whois_config function for setting config variables (if setting imported variables $OMIT_MSG, $CHECK_FAIL etc. doesn't work for some reason, for example because of namespace problems in mod_perl scripts) 0.26 Jan 09 2004 Walery Studennikov - added recursive whois requests for .cc domains - fixed recursive whois requests for whois.crsnic.net 0.27 Feb 10 2004 Alex Kapranoff - patch to check availability of .info and .biz domains 0.28 Feb 20 2004 Alex Kapranoff - fixed documentation for pwhois.PL 0.29 Feb 24 2004 Walery Studennikov - fixed extra rules which strips the copyright message or disclaimer - removed pwhois.PL. "pwhois" is shipped now instead. - data structures in Net/Whois/Raw/Data.pm reformatted - new strip patterns for whois.crsnic.net 0.30 Mar 15 2004 Walery Studennikov - added strip rules for whois.dns.be 0.31 Mar 19 2004 Walery Studennikov - more robust recursive whois queries 0.32 Apr 07 2004 IVAN - small fix allows the module to work under 5.005 0.33 Apr 21 2004 Walery Studennikov - new whois server in Data.pm - whois.regtime.net 0.34 May 18 2004 Richard Poole - new whois server in Data.pm - whois.centralnic.com 0.35 Jun 29 2004 Walery Studennikov - fix of regexp pattern in check_existance 0.36 Jul 22 2004 Richard Poole - fix for Raw.pm that ensures that we do not get confused when looking up a domain which has many entries in the whois database (for WHOIS.CRSNIC.NET) 0.37 Aug 11 2004 Walery Studennikov - fixed recursive whois requests for .tv domains 0.38 Sep 23 2004 Walery Studennikov - fixed recursive whois requests for .ws domains - strip patterns for whois.directnic.com - fix strip mechanism in case of recusive whois requests 0.39 Oct 29 2004 Walery Studennikov - more fixes for Raw.pm that ensures that we do not get confused when looking up a domain which has many entries in the whois database (for WHOIS.CRSNIC.NET) 0.40 Dec 09 2004 Walery Studennikov - add fail pattern for whois.dns.be 0.41 Dec 17 2004 Luis Moreno - fix caching when using a particular whois server in whois function 0.42 Jan 11 2005 Sun Guonian - update hostname of CN whois server 0.43 Feb 04 2005 Walery Studennikov - new options (exported variables): @SRC_IPS, $CHECK_EXCEED 0.90 Mar 03 2005 Walery Studennikov - total rewrite / restructuring of module - new exported function: get_whois 0.91 Mar 04 2005 Walery Studennikov - fixed bug (introduced in v0.90) that caused fault of DNS server whois queries - new test for DNS servers whois 0.92 Mar 28 2005 Walery Studennikov - new fail check patterns 0.93 Apr 13 2005 Walery Studennikov - updated WHOIS server for AU zone 0.94 Apr 26 2005 Marc Jauvin - TIMEOUT implementation fix 0.95 May 16 2005 Walery Studennikov - new parameter "-a" (source ip address) in pwhois script 0.96 Jun 28 2005 Walery Studennikov - ??? 0.97 Jul 26 2005 Bernd Ahlers - update for DENIC whois server 0.98 Sep 19 2005 Bernd Ahlers - small typo fixes 0.99 Jan 10 2006 Walery Studennikov - added whois server for .KZ 1.0.0 Jan 11 2006 Walery Studennikov - new major release: added obtaining WHOIS results via HTTP: now .IN and .KZ domains are queried via HTTP by default. To force querying other domain via HTTP you should provide server name 'www_whois' 1.0.1 Jan 13 2006 Danil Krivopustov - fixed obtaining WHOIS of IP addresses (split_domname function) 1.1.0 Jan 16 2006 Walery Studennikov - improved obtaining WHOIS of IP addresses. Patterns for recursive WHOIS queries were borrowed from Net::Whois::IP. Many thanks to Net::Whois::IP author Ben Schmitz 1.1.1 Jan 18 2006 Walery Studennikov - fix WHOIS-over-HTTP: added missing function koi2win, 1.1.2 Jan 18 2006 Walery Studennikov - switch .spb.ru and .msk.ru to HTTP 1.02 Feb 04 2006 Walery Studennikov - change version numbering scheme - change pynycode names of IDN names 1.03 Mar 21 2006 David Parry - change whois server name for .CA 1.04 Mar 22 2006 Bram - added whois.eu server 1.05 Apr 03 2006 Walery Studennikov - added new options to pwhois script 1.06 Apr 03 2006 Walery Studennikov - fix manual page for pwhois script 1.07 Apr 12 2006 Martin Lee - replaced .JP whois server address 1.08 Jul 26 2006 Reto Grossenbacher - changed WHOIS servers for .CH and .LI domains 1.09 Jul 27 2006 Reto Grossenbacher - fixed strip patterns for yesterday's changes 1.10 Jul 30 2006 K. J. Cheetham - addons to %Net::Whois::Raw::Data::exceed hash 1.11 Aug 10 2006 - changed whois server for .aero (Danil Krivopustov) - added fail check for whois.melbourneit.com (Yulia Shtyrjakova) 1.12 Aug 16 2006 Roman Filippov - changed whois server for .gs 1.13 Aug 20 2006 Doug Barton - Addons + restyling of Net::Whois::Raw::Data 1.14 Aug 24 2006 Doug Barton - Addons to Net::Whois::Raw::Data 1.20 Nov 18 2006 Walery Studennikov - !INTERFACE CHANGE: CACHE_TIME now specifies time in minutes, not in hours. Hours are too rough for some applications. Sorry :( - Bumped version number for the above reason 1.21 Apr 13 2007 Danil Krivopustov - fixes for Net::Whois::Raw::Data 1.22 May 16 2007 Walery Studennikov - Removed legacy RACE encoding support - Default cache time set to 60 minutes - Fixed timeout behaviour. Now timeouts are more robust (Ticket http://rt.cpan.org/Ticket/Display.html?id=27097) - Small refactoring 1.23 May 22 2007 - Added $DEBUG initialization (Walery Studennikov) - Path for obtaining complete WHOIS info for .name domains (Yulia Shtyrjakova) 1.24 Aug 15 2007 Walery Studennikov - More descriptive error message when can't create socket 1.30 Sep 06 2007 Walery Studennikov - Carp::confess instead of die when can't connect - Don't use Exporter anymore; revised export list (can cause some incompatibilities, so version number bumped) 1.31 Sep 06 2007 Walery Studennikov - fexes in pwhois caused by today's module changes 1.32 Sep 07 2007 Walery Srudennikov - added support for WHOIS requests for any object (not only for domain), for example, WHOIS requests for registrars now supported 1.33 Oct 10 2007 Walery Srudennikov - added whois servers for many CentralNIC TLDs in New::Whois::Raw::Data 1.35 Nov 06 2007 Walery Studennikov - strip copyright notices for .mobi domains 1.36 Nov 15 2007 Walery Studennikov - update documentation (setup variables description) - change "use vars" to "our" in Net::Whois::Raw::Data - start to build postprocessing framework (added %Net::Whois::Raw::Data::postprocess) 1.37 Nov 20 2007 Walery Studennikov - added strip patterns for whois.godaddy.com, whois.paycenter.com.cn, whois.enom.com 1.38 Nov 21 2007 Walery Studennikov - added strip patterns for whois.dotster.com 1.39 Nov 22 2007 Walery Studennikov - added strip patterns for whois.nordnet.net 1.40 Feb 04 2008 Sergey Kotenko - fixed parsing of excessive querying for whois.ripn.net 1.41 Feb 08 2008 Sergey Kotenko - added %Net::Whois::Raw::POSTPROCESS 1.42 Feb 25 2008 Sergey Kotenko - added whois server (http) for .VN 1.43 Feb 29 2008 Sergey Kotenko - common code moved to Net::Whois::Raw::Common. Can be used by other modules. 1.50 Mar 11 2008 Sergey Kotenko - version bounce due to a large refactoring - some more code moved to Net::Whois::Raw::Common - new caching mechanism - tests writen for Net::Whois::Raw::Common - tests writen for checking the correctness of whois-servers 1.51 Mar 12 2008 Sergey Kotenko - test 02-internet.t fixed to work correctly on MS Windows. 1.52 Mar 26 2008 Walery Studennikov - .asia support added 1.53 Mar 31 2008 Sergey Kotenko - fixed warnings on cache writing 1.54 Jun 28 2008 Matsui Shinsuke - .ac support added 1.56 Jul 31 2008 Pavel Odintsov - .vn support fixed - HTTP POST requests fixed 1.57 Aug 11 2008 Walery Studennikov - Removed annoying warning from Net/Whois/Raw.pm 1.58 Nov 07 2008 Walery Studennikov - Added .BZ support (www_whois) 1.59 Nov 14 2008 ivan baktsheev - now client can offer his own dns resolver and smart local socket selection - added option to change default socket - added "banned" message from internic 1.60 Nov 14 2008 Walery Studennikov - pwhois script rewritten (use Getopt::Long) - small bugfixes + code layout foxes 1.61 Jan 27 2009 Vadim Likhota, Walery Studennikov - add whois.nic.name for .NS query for .name domains in addition for whois.nsiregistry.net - add Test::More to module requirements - add colourable user agent to satisfy http://nic.ac/ 1.62 Feb 04 2009 Walery Studennikov - fixed getting whois info via HTTP from nic.ac 1.63 Feb 09 2009 Walery Studennikov - turn off test for www_whois_query for 'nic.ac'. It fails too often 1.64 Feb 25 2009 Vadim Likhota, Walery Studennikov - add www.nic.tj whois via www_whois_query (now whois.nic.tj not work) 1.65 Mar 25 2009 Walery Studennikov - add whois server for .TEL domains - SPB.RU and MSK.RU zones are removed from www_whois 1.66 Mar 26 2009 Walery Studennikov - fixed tests 1.67 Mar 30 2009 Alexey Sharipov - fixed caching issues 2.00 Mar 31 2009 Walery Studennikov, Vadim Likhota - core now uses unicode (MAJOR CHANGE!!!!) - all the data in Net::Whois::Raw::Data are counterchecked - duplicating 'strip_whois' and 'check_existance' functions are deleated from Net::Whois::Raw::Common, now only the data from Net::Whois::Raw::Data are used instead of them - now flags OMIT_MSG and CHECK_FAIL supports only true and false values. Support for OMIT_MSG == 2 and CHECK_FAIL == 2 was dropped. - fixes for .CN and .VN domains 2.01 May 14 2009 Walery Studennikov - support exceed pattern for .ws 2.02 Aug 28 2009 - fix for twocows (by DAVINCHI) - fix for "perl spits out an error if $res_srv is undefined" (by Ian Stuart) 2.03 Sep 10 2009 Andrey Kuzmin - add five zones: COM.UA ORG.UA KIEV.UA BIZ.UA NOV.RU 2.04 Sep 16 2009 Walery Studennikov - Support for list of whois servers which has no idn support 2.05 Sep 21 2009 Ilya Chesnokov, Vadim Likhota - fix for .MN zone - fixes for COM.UA ORG.UA KIEV.UA BIZ.UA zones - add zone PP.UA 2.06 Oct 22 2009 Ilya Chesnokov - added internal answer postprocessing 2.07 Nov 24 2009 Walery Studennikov - support for cyrillic .RF domain - fixes for multilingual TLDs 2.08 Nov 24 2009 David T Dzhanaev - multiple ccTLD zones added - fixed case-sensitive search for an appropriate whois 2.09 Nov 26 2009 David T Dzhanaev - support geographic domains for .RU and .SU zones 2.10 Nov 30 2009 David T Dzhanaev - fixed -A param in pwhois (Ticket https://rt.cpan.org/Public/Bug/Display.html?id=52144) 2.11 Dec 1 2009 David T Dzhanaev - fixed 02-internet.t tests broken when no connection (Ticket https://rt.cpan.org/Public/Bug/Display.html?id=41712) - fixed Cache broken in taint mode (Ticket https://rt.cpan.org/Public/Bug/Display.html?id=47216) 2.12 Dec 8 2009 Walery Studennikov - now we require perl 5.8.1 and Encode 2.13 Jan 17 2010 Andrey Suslov - fixed 'v-string' portability warning (Ticket https://rt.cpan.org/Public/Bug/Display.html?id=53084) 2.14 Feb 1 2010 Andrey Suslov - search DNS-servers in .org, .biz, .name zones through a whois-server of appropriate zone 2.15 Feb 1 2010 Andrey Suslov - added more tests to MANIFEST 2.16 Feb 24 2010 Alexander Ponomarev - fixed 'www whois' test 2.17 Feb 24 2010 Roman V. Nikolaev - external hooks support: whois_query_sockparams, whois_query_socket, whois_query_ua 2.18 Mar 25 2010 Walery Studennikov - Coro tests are turned off by default 2.19 Mar 26 2010 Walery Studennikov - Exceed patterns updated for whois.eu - Fixed whois_config (CHECK_EXCEED support) 2.20 Apr 01 2010 Walery Studennikov - $Net::Whois::Raw::USE_CNAMES option removed (who needs it??) - Crutch for rechecking RELCOM-domains through WWW - added 'not found' string for .kg domains 2.21 Apr 20 2010 Ilya Chesnokov - Added whois servers for zones: .MD, .GD, .HT, .IM, .KI, .LC, .TRAVEL, .FM, .CO - Fixed whois servers for zones: .LA, .SB, .VN - Fixed %strip hash for .CX, .MU, .NL, .TL - Added .CM zone 2.22 Apr 26 2010 Walery Studennikov - Fixed $CACHE_TIME parameter documentation - Fixed .CM zone processing - Added real whois server for .KG zone 2.23 Aug 25 2010 Walery Studennikov - Fixed problem with tests for .TJ domains 2.24 Sep 01 2010 Ilya Chesnokov - For .BZ domains whois server changed from www_whois to whois.belizenic.bz 2.25 Sep 02 2010 Ilya Chesnokov - And then again to www_whois (but to another URL) 2.26 Oct 06 2010 Timur Nozadze - Fixed problem with passing server parameter from command line in pwhois - Fixed problem with encoding detection in pwhois on Windows - Added convertation to punycode in pwhois 2.27 Nov 11 2010 Timur Nozadze - Added domain name validation in pwhois - Updated some 'not found' string 2.28 Jan 24 2011 Walery Studennikov - whois.relcom.ru is no more. Using whois.nic.ru instead. - Removed crutches for whois.relcom.ru / www_whois 2.29 Jan 31 2011 Walery Studennikov - Further migration from whois.relcom.ru to whois.nic.ru 2.30 Feb 09 2011 Walery Studennikov - confess -> die :: no need to die such verbosely 2.31 Feb 28 2011 Ilya Chesnokov - Added whois server for .SO zone 2.32 May 19 2011 Timur Nozadze - Deleted whitespaces removing from the whois result 2.33 Jul 29 2011 Ilya Chesnokov - Added whois server for .CO.UA zone 2.34 Aug 01 2011 Ilya Chesnokov - Added whois server for .IN.UA zone 2.35 Sep 06 2011 Ilya Chesnokov - Added whois server for .XXX zone - Fixed BZ whois (restored whois.belizenic.bz server) 2.36 Oct 25 2011 Ilya Chesnokov - Fixed regexp for .PRO whois check 2.37 Nov 24 2011 Walery Studennikov - Fixed whois server address for *.ua domains 2.38 Dec 09 2011 Walery Studennikov - Confess instead of die to simplify error tracing 2.39 Dec 26 2011 Walery Studennikov - internet tests updated - Net::Whois::Raw::Data addons / updates, thanx to Guillaume 2.40 Jan 31 2012 Alex Bykov - Now you can redefine SOCK_CLASS::getline method as you want - require_once for Data::Dumper 2.41 Mar 14 2012 Timur Nozadze - Case-insensitive match for "not found" messages 2.42 Jul 11 2012 Alexander Nalobin - utf8 encoding fix 2.43 Aug 21 2012 gleecology - IPv6 whois support Net-Whois-Raw-2.43/COPYRIGHT000444000000000000 36412014615151 15744 0ustar00unknownunknown000000000000Copyright 2003-2009 Walery Studennikov Copyright 2003-2003 Corris Randall Copyright 2003-2003 Gabor Szabo Copyright 2000-2002 Ariel Brosh This package is free software. You may redistribute it or modify it under the same terms as Perl itself. Net-Whois-Raw-2.43/Makefile.PL000444000000000000 117412014615151 16443 0ustar00unknownunknown000000000000require 5.008001; use ExtUtils::MakeMaker; my $requires = { 'Encode' => 0, 'Getopt::Long' => '2', 'HTTP::Headers' => 0, 'HTTP::Request' => 0, 'LWP::UserAgent' => 0, 'Test::More' => 0, 'URI::URL' => 0, 'Net::IDN::Punycode' => 1, }; if ($^O =~ /Win/) { $requires->{'Win32API::Registry'} = 0; } WriteMakefile ( 'NAME' => 'Net::Whois::Raw', 'VERSION_FROM' => 'lib/Net/Whois/Raw.pm', 'PREREQ_PM' => $requires, 'INSTALLDIRS' => 'site', 'EXE_FILES' => [ 'pwhois' ], 'PL_FILES' => {} ) ; Net-Whois-Raw-2.43/MANIFEST000444000000000000 44512014615151 15602 0ustar00unknownunknown000000000000Build.PL Changes COPYRIGHT lib/Net/Whois/Raw.pm lib/Net/Whois/Raw/Common.pm lib/Net/Whois/Raw/Data.pm Makefile.PL MANIFEST This list of files MANIFEST.SKIP META.yml pwhois README t/01-local.t t/02-internet.t t/03-coverage.t t/04-coro-domains.pl t/example-domains-load-balancing.pl META.json Net-Whois-Raw-2.43/MANIFEST.SKIP000444000000000000 2212014615151 16316 0ustar00unknownunknown000000000000^MYMETA.yml$ .svn Net-Whois-Raw-2.43/META.json000444000000000000 327112014617172 16117 0ustar00unknownunknown000000000000{ "abstract" : "Get Whois information for domains", "author" : [ "Original author Ariel Brosh B,\nInspired by jwhois.pl available on the net.", "Past maintainers Gabor Szabo B,\nCorris Randall B", "Current Maintainer: Walery Studennikov B" ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.113640", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Net-Whois-Raw", "prereqs" : { "configure" : { "requires" : { "Module::Build" : "0.38" } }, "runtime" : { "requires" : { "Encode" : 0, "Getopt::Long" : "2", "HTTP::Headers" : 0, "HTTP::Request" : 0, "LWP::UserAgent" : 0, "Net::IDN::Punycode" : "1", "Test::More" : 0, "URI::URL" : 0, "Win32API::Registry" : 0, "perl" : "5.008001" } } }, "provides" : { "Net::Whois::Raw" : { "file" : "lib/Net/Whois/Raw.pm", "version" : "2.43" }, "Net::Whois::Raw::Common" : { "file" : "lib/Net/Whois/Raw/Common.pm", "version" : 0 }, "Net::Whois::Raw::Data" : { "file" : "lib/Net/Whois/Raw/Data.pm", "version" : 0 } }, "release_status" : "stable", "resources" : { "license" : [ "http://dev.perl.org/licenses/" ] }, "version" : "2.43" } Net-Whois-Raw-2.43/META.yml000444000000000000 215312014617172 15745 0ustar00unknownunknown000000000000--- abstract: 'Get Whois information for domains' author: - "Original author Ariel Brosh B,\nInspired by jwhois.pl available on the net." - "Past maintainers Gabor Szabo B,\nCorris Randall B" - 'Current Maintainer: Walery Studennikov B' build_requires: {} configure_requires: Module::Build: 0.38 dynamic_config: 1 generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.113640' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Net-Whois-Raw provides: Net::Whois::Raw: file: lib/Net/Whois/Raw.pm version: 2.43 Net::Whois::Raw::Common: file: lib/Net/Whois/Raw/Common.pm version: 0 Net::Whois::Raw::Data: file: lib/Net/Whois/Raw/Data.pm version: 0 requires: Encode: 0 Getopt::Long: 2 HTTP::Headers: 0 HTTP::Request: 0 LWP::UserAgent: 0 Net::IDN::Punycode: 1 Test::More: 0 URI::URL: 0 Win32API::Registry: 0 perl: 5.008001 resources: license: http://dev.perl.org/licenses/ version: 2.43 Net-Whois-Raw-2.43/pwhois000444000000000000 1473312014615151 15752 0ustar00unknownunknown000000000000#!/usr/bin/perl -w use strict; use warnings; use Net::Whois::Raw; use Getopt::Long; use Encode; use Net::IDN::Punycode qw( :all ); use utf8; my $help; my $do_strip; my $do_strip_more; my $do_checkfail; my $do_checkfail_more; my $debug = 0; my $timeout = 10; my $enable_caching; my @source_addresses; my $return_first; my $return_last; my $return_all; Getopt::Long::Configure( 'bundling', 'no_ignore_case' ); GetOptions( 'help|h' => \$help, 'strip|s' => \$do_strip, 'checkfail|c' => \$do_checkfail, 'debug|d+' => \$debug, 'timeout|T=i' => \$timeout, 'enable_caching|t' => \$enable_caching, 'src_addr|a=s@' => \@source_addresses, 'return_first|F' => \$return_first, 'return_last|L' => \$return_last, 'return_all|A' => \$return_all, ) or die; if ($help || !@ARGV) { print < ] [ -a ] [ -t ] [ -F | -L | -A ] [ ] Switches: -s attempt to strip the copyright message or disclaimer. -c attempts to return an empty answer for failed searches. -T set timeout for connection attempts -t enables caching. -a specify an ip address that should be used as source address -d enables debugging messages. -F returns results of the first query of recursive whois requests -L returns results of the last query of recursive whois requests (the default) -A returns results of the all queries of recursive whois requests EOM exit; } $Net::Whois::Raw::DEBUG = $debug; $Net::Whois::Raw::OMIT_MSG = $do_strip ? 1 : 0; $Net::Whois::Raw::CHECK_FAIL = $do_checkfail ? 1 : 0; $Net::Whois::Raw::TIMEOUT = $timeout; @Net::Whois::Raw::SRC_IPS = @source_addresses if @source_addresses; if ($enable_caching) { $Net::Whois::Raw::CACHE_DIR = $ENV{TEMP} || ($^O =~ /Win/ ? "C:\\temp" : '/tmp' ); } else { $Net::Whois::Raw::CACHE_DIR = undef; } my ( $input_cp, $output_cp ) = detect_encodings(); my $dom = $ARGV[0]; my $server = $ARGV[1]; $dom = prepare_domain($dom, $input_cp); unless (validate_domain($dom)) { print encode_output("\nIncorrect domain name:\n$dom\n", $output_cp); exit -1; } $dom = to_punycode($dom); eval { my ($result, $result_server); my $which_whois = $return_first ? 'QRY_FIRST' : $return_all ? 'QRY_ALL' : 'QRY_LAST'; ($result, $result_server) = Net::Whois::Raw::get_whois( $dom, $server, $which_whois ); if ($result and ref $result eq 'ARRAY') { make_output($_->{text}, $_->{srv}, $output_cp) for @{$result}; } elsif ($result) { make_output($result, $result_server, $output_cp); } else { print STDERR "Failed.\n"; } }; if ($@) { my $err = $@; $err =~ s/\s+at \S+ line \d+\.$//; print "\nWhois information could not be fetched:\n$err\n"; exit -1; } # Prepare and print output sub make_output { my ($result, $server, $cp) = @_; $result = encode_output( $result, $cp ); print "[$server]\n"; print $result, "\n"; } # Encode output sub encode_output { my ( $output, $cp ) = @_; if ( $cp =~ /utf\-?8/ ) { $output = encode_utf8( $output ); } else { $output = encode( $cp, $output ); } return $output; } # Detect terminal input and output encodings sub detect_encodings { my ( $input_cp, $output_cp ); if ( $^O =~ /Win/ ) { # Read encoding from registry require Win32API::Registry; Win32API::Registry->import( qw( :ALL ) ); my ( $key, $type, $data ); RegOpenKeyEx( HKEY_LOCAL_MACHINE(), 'SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage', 0, KEY_READ(), $key ) or die "Can't read system encodings from registry: ".regLastError(); RegQueryValueEx( $key, 'ACP', [], $type, $data, [] ) or die "Can't read system encodings from registry: ".regLastError(); $input_cp = 'cp'.$data; RegQueryValueEx( $key, 'OEMCP', [], $type, $data, [] ) or die "Can't read system encodings from registry: ".regLastError(); $output_cp = 'cp'.$data; } else { # Read encoding from environment (my $cp = $ENV{LANG}) =~ s/^[a-z]{2}_[A-Z]{2}\.//; $input_cp = $output_cp = lc $cp; } return ($input_cp, $output_cp); } # Prepare domain name sub prepare_domain { my ($dom, $input_cp) = @_; # Decode command-line input $dom = decode($input_cp, $dom); # Lowercase latin and cyrillic characters $dom =~ tr/A-ZА-ЯЁ\xAA\xA5\xB2\xAF/a-zа-яё\xBA\xB4\xB3\xBF/; return $dom; } # Decode domain name to punycode if needed sub to_punycode { my ($dom) = @_; unless ($dom =~ /^[a-z0-9.\-]*$/) { # Convert to Punycode my @parts; foreach my $part (split /\./, $dom) { $part = 'xn--'.Net::IDN::Punycode::encode_punycode( $part ) unless $part =~ /^[a-z0-9.-]*$/; push @parts, $part; } $dom = join('.', @parts); } return $dom; } # Validate domain name sub validate_domain { my ($dom) = @_; return 0 unless $dom; $dom =~ /(.+?)\.([^.]+)$/; my ($name, $tld) = ($1, $2); return 0 if $name =~ /^-/; return 0 if $name =~ /-$/; return 0 if $name =~ /^..--/ && $dom !~ /^xn--/; # Only latin and cyrillic characters allowed now return 0 if $dom =~ m/[^-a-z0-9\.ёа-я\xAA\xBA\xB4\xB2\xB3\xAF\xBF\xA1\xA2]/; return 1; } __END__ =head1 NAME pwhois - Perl written whois client =head1 SYNOPSIS pwhois perl.com pwhois gnu.org pwhois -s police.co.il pwhois -c there.is.no.tld.called.foobar pwhois yahoo.com whois.networksolutions.com pwhois -T 10 funet.fi etc etc..... =head1 DESCRIPTION Just invoke with a domain name, optionally with a whois server name. Switches: B<-s> attempt to strip the copyright message or disclaimer. B<-c> attempts to return an empty answer for failed searches. B<-e> forces die if connection rate to server have been exceeded. B<-T> set timeout for connection attempts B<-t> enables caching. B<-a> specify an ip address that should be used as source address B<-d> enables debugging messages. B<-F> returns results of the first query of recursive whois requests B<-L> returns results of the last query of recursive whois requests (the default) B<-A> returns results of the all queries of recursive whois requests =head1 AUTHORS Ariel Brosh B Current Maintainer: Walery Studennikov B =head1 SEE ALSO L. Net-Whois-Raw-2.43/README000444000000000000 1552012014615151 15371 0ustar00unknownunknown000000000000NAME Net::Whois::Raw - Get Whois information for domains SYNOPSIS use Net::Whois::Raw; $dominfo = whois('perl.com'); ($dominfo, $whois_server) = whois('funet.fi'); $reginfo = whois('REGRU-REG-RIPN', 'whois.ripn.net'); $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'); $Net::Whois::Raw::OMIT_MSG = 1; # This will attempt to strip several known copyright # messages and disclaimers sorted by servers. # Default is to give the whole response. $Net::Whois::Raw::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. $Net::Whois::Raw::CHECK_EXCEED = 1; # When this option is set, "die" will be called # if connection rate to specific whois server have been # exceeded $Net::Whois::Raw::CACHE_DIR = "/var/spool/pwhois/"; # Whois information will be # cached in this directory. Default is no cache. $Net::Whois::Raw::CACHE_TIME = 60; # Cache files will be cleared after not accessed # for a specific number of minutes. Documents will not be # cleared if they keep get requested for, independent # of disk space. $Net::Whois::Raw::TIMEOUT = 10; # Cancel the request if connection is not made within # a specific number of seconds. @Net::Whois::Raw::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 $Net::Whois::Raw::POSTPROCESS{whois.crsnic.net} = \&my_func; # Call to a user-defined subroutine on whois result, # depending on whois-server. # Above is equil to: # ($text, $srv) = whois('example.com'); # $text = my_func($text) if $srv eq 'whois.crsnic.net'; DESCRIPTION Net::Whois::Raw queries WHOIS servers about domains. The module supports recursive WHOIS queries. Also queries via HTTP is supported for some TLDs. Setting the variables $OMIT_MSG and $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 [, WHICH_WHOIS]] ) Returns Whois information for "DOMAIN". Without "SRV" argument default Whois server for specified domain name zone will be used. Use 'www_whois' as server name to force WHOIS querying via HTTP (only few TLDs are supported in HTTP queries). Caching is supported: if $CACHE_DIR variable is set and there is cached entry for that domain - information from the cache will be used. "WHICH_WHOIS" argument - look get_whois docs below. get_whois( DOMAIN [, SRV [, WHICH_WHOIS]] ) Lower-level function to query Whois information for "DOMAIN". Caching IS NOT supported (caching is implemented only in higher-level "whois" function). Without "SRV" argument default Whois server for specified domain name zone will be used. "WHICH_WHOIS" argument is used to access a results if recursive queries; possible values: '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). '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. 'QRY_ALL' - returns results of the all queries of the recursive chain. Reference to array of references to hashes is returned. Hash keys: "text" - result of whois query, "srv" - whois server which was used to make query. USER DEFINED FUNCTIONS whois_query_sockparams( DOMAIN, SRV ) You can set your own IO::Socket::INET params like this: *Net::Whois::Raw::whois_query_sockparams = sub { my $class = shift; my $domain = shift; my $name = shift; return ( PeerAddr => $name, PeerPort => 43, # LocalHost => , # LocalPort => ); }; whois_query_socket( DOMAIN, SRV ) You can set your own IO::Socket::INET like this: *Net::Whois::Raw::whois_query_socket = sub { my $class = shift; my $domain = shift; my $name = shift; $name .= ':43'; return IO::Socket::INET->new(); }; whois_query_ua( DOMAIN, SRV ) You can set your own LWP::UserAgent like this: *Net::Whois::Raw::whois_query_ua = sub { my $class = shift; my $domain = shift; return LWP::UserAgent->new(); }; 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 See file "Changes" in the distribution for the complete list of contributors. 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--now() 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 pwhois, whois. Net-Whois-Raw-2.43/lib000755000000000000 012014617173 15105 5ustar00unknownunknown000000000000Net-Whois-Raw-2.43/lib/Net000755000000000000 012014617173 15633 5ustar00unknownunknown000000000000Net-Whois-Raw-2.43/lib/Net/Whois000755000000000000 012014617173 16724 5ustar00unknownunknown000000000000Net-Whois-Raw-2.43/lib/Net/Whois/Raw.pm000444000000000000 4073512014615561 20200 0ustar00unknownunknown000000000000package Net::Whois::Raw; require 5.008_001; require Net::Whois::Raw::Common; require Net::Whois::Raw::Data; use strict; use Carp; use IO::Socket; use Encode; use utf8; our @EXPORT = qw( whois get_whois ); our $VERSION = '2.43'; our ($OMIT_MSG, $CHECK_FAIL, $CHECK_EXCEED, $CACHE_DIR, $TIMEOUT, $DEBUG) = (0) x 7; our $CACHE_TIME = 60; our $SET_CODEPAGE = ''; our $SILENT_MODE = 0; our (%notfound, %strip, @SRC_IPS, %POSTPROCESS); our $class = __PACKAGE__; my $last_cache_clear_time; sub whois_config { my ($par) = @_; my @parnames = qw(OMIT_MSG CHECK_FAIL CHECK_EXCEED CACHE_DIR CACHE_TIME TIMEOUT @SRC_IPS); foreach my $parname (@parnames) { if (exists($par->{$parname})) { no strict 'refs'; ${$parname} = $par->{$parname}; } } } sub whois_config_data { my $net_whois_raw_data = shift; no strict 'refs'; foreach my $k (keys %$net_whois_raw_data) { %{'Net::Whois::Raw::Data::'.$k} = ( %{'Net::Whois::Raw::Data::'.$k}, %{ $net_whois_raw_data->{ $k } || {} }, ); } } # get cached whois sub whois { my ($dom, $server, $which_whois) = @_; $which_whois ||= 'QRY_LAST'; my $res = Net::Whois::Raw::Common::get_from_cache( $dom, $CACHE_DIR, $CACHE_TIME ); my ($res_text, $res_srv, $res_text2); if ($res) { if ($which_whois eq 'QRY_FIRST') { $res_text = $res->[0]->{text}; $res_srv = $res->[0]->{srv}; } elsif ($which_whois eq 'QRY_LAST' || !defined($which_whois)) { $res_text = $res->[-1]->{text}; $res_srv = $res->[-1]->{srv}; } } else { ($res_text, $res_srv) = get_whois($dom, $server, $which_whois); } $res_srv = '' if $res_srv && $res_srv eq 'www_whois'; if ( $which_whois ne 'QRY_ALL' ) { utf8::decode( $res_text ); # Perl whyly loss utf8 flag $res_text = encode( $SET_CODEPAGE, $res_text ) if $SET_CODEPAGE; } return wantarray ? ($res_text, $res_srv) : $res_text; } # obtain whois sub get_whois { my ($dom, $srv, $which_whois) = @_; $which_whois ||= 'QRY_LAST'; my $whois = get_all_whois($dom, $srv, $which_whois eq 'QRY_FIRST') or return undef; Net::Whois::Raw::Common::write_to_cache($dom, $whois, $CACHE_DIR); if ($which_whois eq 'QRY_LAST') { my $thewhois = $whois->[-1]; return wantarray ? ($thewhois->{text}, $thewhois->{srv}) : $thewhois->{text}; } elsif ($which_whois eq 'QRY_FIRST') { my $thewhois = $whois->[0]; return wantarray ? ($thewhois->{text}, $thewhois->{srv}) : $thewhois->{text}; } else { return $whois; } } sub get_all_whois { my ($dom, $srv, $norecurse) = @_; my $is_ns = 0; $is_ns = 1 if $dom =~ s/.NS$//i; $srv ||= Net::Whois::Raw::Common::get_server( $dom, $is_ns ); if ($srv eq 'www_whois') { my ($responce, $ishtml) = www_whois_query( $dom ); return $responce ? [ { text => $responce, srv => $srv } ] : $responce; } my @whois = recursive_whois( $dom, $srv, [], $norecurse, $is_ns ); my $whois_answers = process_whois_answers( \@whois, $dom ); return $whois_answers; } sub process_whois_answers { my ($raw_whois, $dom) = @_; my @processed_whois; my $level = 0; foreach my $whois_rec (@{$raw_whois}) { $whois_rec->{level} = $level; my ($text, $error) = Net::Whois::Raw::Common::process_whois( $dom, $whois_rec->{srv}, $whois_rec->{text}, $CHECK_FAIL, $OMIT_MSG, $CHECK_EXCEED, ); die $error if $level == 0 && $error && $error eq "Connection rate exceeded"; if ($text || $level == 0) { $whois_rec->{text} = $text; push @processed_whois, $whois_rec; } $level++; } return \@processed_whois; } sub recursive_whois { my ($dom, $srv, $was_srv, $norecurse, $is_ns) = @_; my $lines = whois_query( $dom, $srv, $is_ns ); my $whois = join("", @{$lines}); my ($newsrv, $registrar); foreach (@{$lines}) { $registrar ||= /Registrar/ || /Registered through/; if ( $registrar && !$norecurse && /Whois Server:\s*([A-Za-z0-9\-_\.]+)/ ) { $newsrv = lc $1; } elsif ($whois =~ /To single out one record, look it up with \"xxx\",/s) { return recursive_whois( "=$dom", $srv, $was_srv ); } elsif (/ReferralServer: whois:\/\/([-.\w]+)/) { $newsrv = $1; last; } elsif (/Contact information can be found in the (\S+)\s+database/) { $newsrv = $Net::Whois::Raw::Data::ip_whois_servers{ $1 }; } elsif ((/OrgID:\s+(\w+)/ || /descr:\s+(\w+)/) && Net::Whois::Raw::Common::is_ipaddr($dom)) { my $val = $1; if($val =~ /^(?:RIPE|APNIC|KRNIC|LACNIC)$/) { $newsrv = $Net::Whois::Raw::Data::ip_whois_servers{ $val }; last; } } elsif (/^\s+Maintainer:\s+RIPE\b/ && Net::Whois::Raw::Common::is_ipaddr($dom)) { $newsrv = $Net::Whois::Raw::Data::servers{RIPE}; } elsif ( $is_ns && $srv ne $Net::Whois::Raw::Data::servers{NS} ) { $newsrv = $Net::Whois::Raw::Data::servers{NS}; } } if ($dom =~ /^xn--/i && $newsrv && $Net::Whois::Raw::Data::whois_servers_with_no_idn_support{$newsrv}) { # Bypass recursing to WHOIS servers with no IDN support $newsrv = undef; } my @whois_recs = ( { text => $whois, srv => $srv } ); if ($newsrv && $newsrv ne $srv) { warn "recurse to $newsrv\n" if $DEBUG; return () if grep {$_ eq $newsrv} @$was_srv; my @new_whois_recs = eval { recursive_whois( $dom, $newsrv, [@$was_srv, $srv], 0, $is_ns) }; my $new_whois = scalar(@new_whois_recs) ? $new_whois_recs[0]->{text} : ''; my $notfound = $Net::Whois::Raw::Data::notfound{$newsrv}; if ( $new_whois && !$@ && not ( $notfound && $new_whois =~ /$notfound/im ) ) { if ( $is_ns ) { unshift @whois_recs, @new_whois_recs; } else { push @whois_recs, @new_whois_recs; } } else { warn "recursive query failed\n" if $DEBUG; } } return @whois_recs; } sub whois_query { my ($dom, $srv, $is_ns) = @_; # Prepare query my $whoisquery = Net::Whois::Raw::Common::get_real_whois_query($dom, $srv, $is_ns); # Prepare for query my (@sockparams, $sock); if ($class->can ('whois_query_sockparams')) { @sockparams = $class->whois_query_sockparams ($dom, $srv); } # hook for outside defined socket elsif ($class->can ('whois_query_socket')) { $sock = $class->whois_query_socket ($dom, $srv); } elsif (scalar(@SRC_IPS)) { my $src_ip = $SRC_IPS[0]; push @SRC_IPS, shift @SRC_IPS; # rotate ips @sockparams = (PeerAddr => "$srv:43", LocalAddr => $src_ip); } else { @sockparams = "$srv:43"; } print "QUERY: $whoisquery; SRV: $srv, ". "OMIT_MSG: $OMIT_MSG, CHECK_FAIL: $CHECK_FAIL, CACHE_DIR: $CACHE_DIR, ". "CACHE_TIME: $CACHE_TIME, TIMEOUT: $TIMEOUT\n" if $DEBUG >= 2; my $prev_alarm = 0; my @lines; # Make query eval { local $SIG{'ALRM'} = sub { die "Connection timeout to $srv" }; $prev_alarm = alarm $TIMEOUT if $TIMEOUT; unless($sock){ $sock = IO::Socket::INET->new(@sockparams) || die "$srv: $!: ".join(', ', @sockparams); } if ($class->can ('whois_socket_fixup')) { my $new_sock = $class->whois_socket_fixup ($sock); $sock = $new_sock if $new_sock; } if ($DEBUG > 2) { require Data::Dumper; print "Socket: ". Data::Dumper::Dumper($sock); } $sock->print( $whoisquery, "\r\n" ); # TODO: $soc->read, parameters for read chunk size, max content length # Now you can redefine SOCK_CLASS::getline method as you want while (my $str = $sock->getline) { push @lines, $str; } $sock->close; }; alarm $prev_alarm; Carp::confess $@ if $@; foreach (@lines) { s/\r//g; } print "Received ".scalar(@lines)." lines\n" if $DEBUG >= 2; return \@lines; } sub www_whois_query { my ($dom) = (lc shift); my ($resp, $url); my ($name, $tld) = Net::Whois::Raw::Common::split_domain( $dom ); my $http_query_urls = Net::Whois::Raw::Common::get_http_query_url($dom); foreach my $qurl ( @{$http_query_urls} ) { # load-on-demand unless ($INC{'LWP/UserAgent.pm'}) { require LWP::UserAgent; require HTTP::Request; require HTTP::Headers; require URI::URL; import LWP::UserAgent; import HTTP::Request; import HTTP::Headers; import URI::URL; } my $referer = delete $qurl->{form}{referer} if $qurl->{form} && defined $qurl->{form}{referer}; my $method = ( $qurl->{form} && scalar(keys %{$qurl->{form}}) ) ? 'POST' : 'GET'; my $ua; # hook for outside defined lwp if ($class->can ('whois_query_ua')) { $ua = $class->whois_query_ua ($dom); } unless($ua){ $ua = new LWP::UserAgent( parse_head => 0 ); $ua->agent('Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.9.0.5) Gecko/2008121622 Fedora/3.0.5-1.fc10 Firefox/3.0.5'); } my $header = HTTP::Headers->new; $header->header('Referer' => $referer) if $referer; my $req = new HTTP::Request $method, $qurl->{url}, $header; if ($method eq 'POST') { require URI::URL; import URI::URL; my $curl = url("http:"); $req->content_type('application/x-www-form-urlencoded'); $curl->query_form( %{$qurl->{form}} ); $req->content( $curl->equery ); } $resp = eval { local $SIG{ALRM} = sub { die "www_whois connection timeout" }; alarm 10; $ua->request($req)->content; }; alarm 0; if ( !$resp || $@ || $resp =~ /www_whois connection timeout/ || $resp =~ /^500 Can\'t connect/ ) { undef $resp; } else { $url = $qurl->{url}; last; } } return undef unless $resp; chomp $resp; $resp =~ s/\r//g; my $ishtml; $resp = Net::Whois::Raw::Common::parse_www_content($resp, $tld, $url, $CHECK_EXCEED); return wantarray ? ($resp, $ishtml) : $resp; } sub import { my $mypkg = shift; my $callpkg = caller; no strict 'refs'; # export subs *{"$callpkg\::$_"} = \&{"$mypkg\::$_"} foreach ((@EXPORT, @_)); } 1; __END__ =head1 NAME Net::Whois::Raw -- Get Whois information for domains =head1 SYNOPSIS use Net::Whois::Raw; $dominfo = whois('perl.com'); ($dominfo, $whois_server) = whois('funet.fi'); $reginfo = whois('REGRU-REG-RIPN', 'whois.ripn.net'); $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'); $Net::Whois::Raw::OMIT_MSG = 1; # This will attempt to strip several known copyright # messages and disclaimers sorted by servers. # Default is to give the whole response. $Net::Whois::Raw::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. $Net::Whois::Raw::CHECK_EXCEED = 1; # When this option is set, "die" will be called # if connection rate to specific whois server have been # exceeded $Net::Whois::Raw::CACHE_DIR = "/var/spool/pwhois/"; # Whois information will be # cached in this directory. Default is no cache. $Net::Whois::Raw::CACHE_TIME = 60; # Cache files will be cleared after not accessed # for a specific number of minutes. Documents will not be # cleared if they keep get requested for, independent # of disk space. $Net::Whois::Raw::TIMEOUT = 10; # Cancel the request if connection is not made within # a specific number of seconds. @Net::Whois::Raw::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 $Net::Whois::Raw::POSTPROCESS{whois.crsnic.net} = \&my_func; # Call to a user-defined subroutine on whois result, # depending on whois-server. # Above is equil to: # ($text, $srv) = whois('example.com'); # $text = my_func($text) if $srv eq 'whois.crsnic.net'; =head1 DESCRIPTION Net::Whois::Raw queries WHOIS servers about domains. The module supports recursive WHOIS queries. Also queries via HTTP is supported for some TLDs. Setting the variables $OMIT_MSG and $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. B: these checks merely use pattern matching; they will work on several servers but certainly not on all of them. =head1 FUNCTIONS =over 3 =item whois( DOMAIN [, SRV [, WHICH_WHOIS]] ) Returns Whois information for C. Without C argument default Whois server for specified domain name zone will be used. Use 'www_whois' as server name to force WHOIS querying via HTTP (only few TLDs are supported in HTTP queries). Caching is supported: if $CACHE_DIR variable is set and there is cached entry for that domain - information from the cache will be used. C argument - look get_whois docs below. =item get_whois( DOMAIN [, SRV [, WHICH_WHOIS]] ) Lower-level function to query Whois information for C. Caching IS NOT supported (caching is implemented only in higher-level C function). Without C argument default Whois server for specified domain name zone will be used. C argument is used to access a results if recursive queries; possible values: C<'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). C<'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. C<'QRY_ALL'> - returns results of the all queries of the recursive chain. Reference to array of references to hashes is returned. Hash keys: C - result of whois query, C - whois server which was used to make query. =back =head1 USER DEFINED FUNCTIONS =over 3 =item whois_query_sockparams( DOMAIN, SRV ) You can set your own IO::Socket::INET params like this: *Net::Whois::Raw::whois_query_sockparams = sub { my $class = shift; my $domain = shift; my $name = shift; return ( PeerAddr => $name, PeerPort => 43, # LocalHost => , # LocalPort => ); }; =item whois_query_socket( DOMAIN, SRV ) You can set your own IO::Socket::INET like this: *Net::Whois::Raw::whois_query_socket = sub { my $class = shift; my $domain = shift; my $name = shift; $name .= ':43'; return IO::Socket::INET->new(); }; =item whois_query_ua( DOMAIN, SRV ) You can set your own LWP::UserAgent like this: *Net::Whois::Raw::whois_query_ua = sub { my $class = shift; my $domain = shift; return LWP::UserAgent->new(); }; =back =head1 AUTHOR Original author Ariel Brosh B, Inspired by jwhois.pl available on the net. Since Ariel has passed away in September 2002: Past maintainers Gabor Szabo B, Corris Randall B Current Maintainer: Walery Studennikov B =head1 CREDITS See file "Changes" in the distribution for the complete list of contributors. =head1 CHANGES See file "Changes" in the distribution =head1 NOTE Some users complained that the B statements in the module make their CGI scripts crash. Please consult the entries on B and B on L about exception handling in Perl. =head1 COPYRIGHT Copyright 2000--2002 Ariel Brosh. Copyright 2003--2003 Gabor Szabo. Copyright 2003--2003 Corris Randall. Copyright 2003--now() 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. =head1 COMMERCIAL SUPPORT Not available anymore. =head1 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. =head1 SEE ALSO L, L. =cut Net-Whois-Raw-2.43/lib/Net/Whois/Raw000755000000000000 012014617173 17455 5ustar00unknownunknown000000000000Net-Whois-Raw-2.43/lib/Net/Whois/Raw/Common.pm000444000000000000 4102412014615541 21416 0ustar00unknownunknown000000000000package Net::Whois::Raw::Common; use Encode; use strict; require Net::Whois::Raw::Data; use utf8; # func prototype sub untaint(\$); # get whois from cache sub get_from_cache { my ($query, $cache_dir, $cache_time) = @_; return undef unless $cache_dir; mkdir $cache_dir unless -d $cache_dir; my $now = time; # clear the cache foreach my $fn ( glob("$cache_dir/*") ) { my $mtime = ( stat($fn) )[9] or next; my $elapsed = $now - $mtime; untaint $fn; untaint $elapsed; unlink $fn if ( $elapsed / 60 >= $cache_time ); } my $result; if ( -e "$cache_dir/$query.00" ) { my $level = 0; while ( open( my $cache_fh, '<', "$cache_dir/$query.".sprintf( "%02d", $level ) ) ) { $result->[$level]->{srv} = <$cache_fh>; chomp $result->[$level]->{srv}; $result->[$level]->{text} = join "", <$cache_fh>; if ( !$result->[$level]->{text} and $Net::Whois::Raw::CHECK_FAIL ) { $result->[$level]->{text} = undef ; } else { $result->[$level]->{text} = decode_utf8( $result->[$level]->{text} ); } $level++; close $cache_fh; } } return $result; } # write whois to cache sub write_to_cache { my ($query, $result, $cache_dir) = @_; return unless $cache_dir && $result; mkdir $cache_dir unless -d $cache_dir; untaint $query; untaint $cache_dir; my $level = 0; foreach my $res ( @{$result} ) { local $res->{text} = $res->{whois} if not exists $res->{text}; next if defined $res->{text} && !$res->{text} || !defined $res->{text}; utf8::encode( $res->{text} ); my $postfix = sprintf("%02d", $level); if ( open( my $cache_fh, '>', "$cache_dir/$query.$postfix" ) ) { print $cache_fh $res->{srv} ? $res->{srv} : ( $res->{server} ? $res->{server} : '') , "\n"; print $cache_fh $res->{text} ? $res->{text} : ''; close $cache_fh; chmod 0666, "$cache_dir/$query.$postfix"; } $level++; } } # remove copyright messages, check for existance sub process_whois { my ($query, $server, $whois, $CHECK_FAIL, $OMIT_MSG, $CHECK_EXCEED) = @_; $server = lc $server; my ($name, $tld) = split_domain($query); # use string as is no utf8; if ( $CHECK_EXCEED ) { my $exceed = $Net::Whois::Raw::Data::exceed{$server}; if ( $exceed && $whois =~ /$exceed/s) { return $whois, "Connection rate exceeded"; } } if ( $CHECK_FAIL || $OMIT_MSG ) { my %notfound = %Net::Whois::Raw::Data::notfound; my %strip = %Net::Whois::Raw::Data::strip; my $notfound = $notfound{$server}; my @strip = $strip{$server} ? @{$strip{$server}} : (); my @lines; MAIN: foreach (split(/\n/, $whois)) { if ( $CHECK_FAIL && $notfound && /$notfound/ ) { return undef, "Not found"; }; if ($OMIT_MSG) { foreach my $re (@strip) { next MAIN if (/$re/); } } push(@lines, $_); } $whois = join "\n", @lines, ''; if ( $OMIT_MSG ) { $whois =~ s/(?:\s*\n)+$/\n/s; $whois =~ s/^\n+//s; $whois =~ s|\n{3,}|\n\n|sg; } } if ( defined $Net::Whois::Raw::Data::postprocess{$server} ) { $whois = $Net::Whois::Raw::Data::postprocess{$server}->($whois); } if ( defined $Net::Whois::Raw::POSTPROCESS{$server} ) { $whois = $Net::Whois::Raw::POSTPROCESS{$server}->($whois); } if ( defined $Net::Whois::Raw::Data::codepages{$server} ) { $whois = decode( $Net::Whois::Raw::Data::codepages{$server}, $whois ); } else { utf8::decode( $whois ); } return $whois, undef; } # get whois-server for domain / tld sub get_server { my ($dom, $is_ns, $tld) = @_; $tld ||= get_dom_tld( $dom ); $tld = uc $tld; if ( grep { $_ eq $tld } @Net::Whois::Raw::Data::www_whois ) { return 'www_whois'; } my $srv = ''; if ( $is_ns ) { $srv = $Net::Whois::Raw::Data::servers{ $tld . '.NS' } || $Net::Whois::Raw::Data::servers{ 'NS' }; } else { my $cname = "$tld.whois-servers.net"; $srv = $Net::Whois::Raw::Data::servers{ $tld } || $cname; } return $srv; } sub get_real_whois_query{ my ($whoisquery, $srv, $is_ns) = @_; $srv = $is_ns ? $srv . '.ns' : $srv; if ($srv eq 'whois.crsnic.net' && domain_level($whoisquery) == 2) { $whoisquery = "domain $whoisquery"; } elsif ( $Net::Whois::Raw::Data::query_prefix{ $srv } ) { $whoisquery = $Net::Whois::Raw::Data::query_prefix{ $srv } . $whoisquery; } return $whoisquery; } # get domain TLD sub get_dom_tld { my ($dom) = @_; my $tld; if ( is_ipaddr($dom) || is_ip6addr($dom) ) { $tld = "IP"; } elsif ( domain_level($dom) == 1 ) { $tld = "NOTLD"; } else { my @alltlds = keys %Net::Whois::Raw::Data::servers; @alltlds = sort { dlen($b) <=> dlen($a) } @alltlds; foreach my $awailtld (@alltlds) { if ($dom =~ /(.+?)\.($awailtld)$/i) { $tld = $2; last; } } unless ($tld) { my @tokens = split(/\./, $dom); $tld = $tokens[-1]; } } return $tld; } # get URL for query via HTTP # %param: domain* sub get_http_query_url { my ($domain) = @_; my ($name, $tld) = split_domain($domain); my @http_query_data; # my ($url, %form); my $server = get_server( undef, undef, $tld ); if ($tld eq 'tv') { my $data = { url => "http://www.tv/cgi-bin/whois.cgi?domain=$name&tld=tv", form => '', }; push @http_query_data, $data; } elsif ($tld eq 'mu') { my $data = { url => 'http://www.mu/cgi-bin/mu_whois.cgi', form => { whois => $name, }, }; push @http_query_data, $data; } elsif ($tld eq 'ru' || $tld eq 'su') { my $data = { url => "http://www.nic.ru/whois/?domain=$name.$tld", form => '', }; push @http_query_data, $data; } elsif ($tld eq 'ip') { my $data = { url => "http://www.nic.ru/whois/?ip=$name", form => '', }; push @http_query_data, $data; } elsif ($tld eq 'in') { my $data = { url => "http://www.registry.in/cgi-bin/whois.cgi?whois_query_field=$name", form => '', }; push @http_query_data, $data; } elsif ($tld eq 'cn') { my $data = { url => "http://ewhois.cnnic.net.cn/whois?value=$name.$tld&entity=domain", form => '', }; push @http_query_data, $data; } elsif ($tld eq 'ws') { my $data = { url => "http://worldsite.ws/utilities/lookup.dhtml?domain=$name&tld=$tld", form => '', }; push @http_query_data, $data; } elsif ($tld eq 'kz') { my $data = { url => "http://www.nic.kz/cgi-bin/whois?query=$name.$tld&x=0&y=0", form => '', }; push @http_query_data, $data; } elsif ($tld eq 'vn') { my $data = { url => "http://www.tenmien.vn/jsp/jsp/tracuudomain1.jsp", form => { cap2 => ".$tld", referer => 'http://www.vnnic.vn/english/', domainname1 => $name, }, }; push @http_query_data, $data; } elsif ($tld eq 'ac') { my $data = { url => "http://nic.ac/cgi-bin/whois?query=$name.$tld", form => '', }; push @http_query_data, $data; } elsif ($tld eq 'bz') { my $data = { url => "http://www.belizenic.bz/index.php/home/whois_result?domain=$name.$tld", }; push @http_query_data, $data; } elsif ($tld eq 'tj') { #my $data = { # url => "http://get.tj/whois/?lang=en&domain=$domain", # from => '', #}; #push @http_query_data, $data; # first level on nic.tj #$data = { # url => "http://www.nic.tj/cgi/lookup2?domain=$name", # from => '', #}; #push @http_query_data, $data; # second level on nic.tj my $data = { url => "http://www.nic.tj/cgi/whois?domain=$name", from => '', }; push @http_query_data, $data; #$data = { # url => "http://ns1.nic.tj/cgi/whois?domain=$name", # from => '', #}; #push @http_query_data, $data; #$data = { # url => "http://62.122.137.16/cgi/whois?domain=$name", # from => '', #}; #push @http_query_data, $data; } elsif ($tld eq 'cm') { my $data = { url => "http://www.register.cm/whois.php", form => { domain => $domain, submit => 'Go', }, }; push @http_query_data, $data; } # return $url, %form; return \@http_query_data; } sub have_reserve_url { my ( $tld ) = @_; my %tld_list = ( 'tj' => 1, ); return defined $tld_list{$tld}; } # Parse content received from HTTP server # %param: resp*, tld* sub parse_www_content { my ($resp, $tld, $url, $CHECK_EXCEED) = @_; my $server = get_server( undef, undef, $tld ); chomp $resp; $resp =~ s/\r//g; my $ishtml; if ($tld eq 'tv') { $resp = decode_utf8( $resp ); return 0 unless $resp =~ /(.+?<\/TABLE>)/is; $resp = $1; $resp =~ s/

.+?The data in The.+?any time.+?

//is; return 0 if $resp =~ /Whois information is not available for domain/s; $ishtml = 1; } elsif ($tld eq 'mu') { $resp = decode_utf8( $resp ); return 0 unless $resp =~ /(

Domain Name:<\/b>
.+?)


/s; $resp = $1; $ishtml = 1; } elsif ( $tld eq 'ru' || $tld eq 'su' ) { $resp = decode( 'koi8-r', $resp ); (undef, $resp) = split('',$resp); ($resp) = split('
', $resp); $resp =~ s/ / /gi; $resp =~ s/<([^>]|\n)*>//gi; return 0 if $resp=~ m/Доменное имя .*? не зарегистрировано/i; $resp = 'ERROR' if $resp =~ m/Error:/i || $resp !~ m/Информация о домене .+? \(по данным WHOIS.RIPN.NET\):/; #TODO: errors } elsif ($tld eq 'ip') { $resp = decode_utf8( $resp ); return 0 unless $resp =~ m|

(.+?)

|s; $resp = $1; $resp =~ s|||g; $resp =~ s|||g; $resp =~ s|
||g; $resp =~ s| | |g; } elsif ($tld eq 'in') { $resp = decode_utf8( $resp ); if ( $resp =~ /Domain ID:\w{3,10}-\w{4}\n(.+?)\n\n/s ) { $resp = $1; $resp =~ s/
//g; } else { return 0; } } elsif ($tld eq 'cn') { $resp = decode_utf8( $resp ); if ($resp =~ m|\n\n(.+?)\n
|s) { $resp = $1; $resp =~ s|||isg; $resp =~ s|||isg; $resp =~ s|||isg; $resp =~ s|||isg; $resp =~ s|.+?||isg; $resp =~ s|||isg; $resp =~ s|\n\s+|\n|sg; $resp =~ s|\n\n|\n|sg; } else { return 0; } } elsif ($tld eq 'ws') { $resp = decode_utf8( $resp ); if ($resp =~ /Whois information for .+?:(.+?)/s) { $resp = $1; $resp =~ s|||isg; $resp =~ s|||isg; $ishtml = 1; } else { return 0; } } elsif ($tld eq 'kz') { $resp = decode_utf8( $resp ); if ($resp =~ /Domain Name\.{10}/s && $resp =~ /
(.+?)<\/pre>/s) {
	    $resp = $1;
	}
	else {
	    return 0;
	}
    }
    elsif ($tld eq 'vn') {

        $resp = decode_utf8( $resp );

        if ($resp =~ /\(\s*?(Domain .+?:\s*registered)\s*?\)/i )  {
            $resp = $1;
        }
	else {
            return 0;
        }

        #
	# if ($resp =~/#ENGLISH.*?<\/tr>(.+?)<\/table>/si) {
	#    $resp = $1;
	#    $resp =~ s|||ig;
	#    $resp =~ s| ||ig;
	#    $resp =~ s|
|\n|ig; # $resp =~ s|
\s*\s*(.*?)\s*\s*\s*(.*?)\s*\s*|$1 $2\n|isg; # $resp =~ s|^\s*||mg; # } elsif ($tld eq 'ac') { $resp = decode_utf8( $resp ); if ($CHECK_EXCEED && $resp =~ /too many requests/is) { die "Connection rate exceeded"; } elsif ($resp =~ /(.+?)/is) { $resp = $1; $resp =~ s|||ig; $resp =~ s|||ig; $resp =~ s|||ig; $resp =~ s|\s*\s*(.*?)\s*\s*\s*(.*?)\s*\s*|$1 $2\n|isg; $resp =~ s|||ig; $resp =~ s|||ig; $resp =~ s|^\s*||mg; } else { return 0; } } elsif ($tld eq 'bz') { $resp = decode_utf8( $resp ); if ( $resp =~ m{
\s*
 # opening tags
                \s* (.*?) \s*       # whois info
                             # strange closing tag - w/o slash
            }xms )
        {
            $resp = $1;
            if ( $resp =~ /NOT\s+FOUND/ || $resp =~ /No\s+Domain/ ) {
                # Whois info not found
                return 0;
            }
        }
        else {
            return 0;
        }
    }
    elsif ( $tld eq 'tj' && $url =~ m|^http\://get\.tj| ) {

        $resp = decode_utf8( $resp );

        if ($resp =~ m|\n(.+?)|s ) {
            $resp = $1;
            $resp =~ s|<[^<>]+>||ig;
            $resp =~ s|Whois\n|\n|s;

            return 0 if $resp =~ m|Domain \S+ is free|s;

            $resp =~ s|Domain \S+ is already taken\.\n|\n|s;
            $resp =~ s| | |ig;
            $resp =~ s|«|"|ig;
            $resp =~ s|»|"|ig;
            $resp =~ s|\n\s+|\n|sg;
            $resp =~ s|\s+\n|\n|sg;
            $resp =~ s|\n\n|\n|sg;
        }
        else {
            return 0;
        }

    }
    elsif ( $tld eq 'cm'  ) {
        $resp = decode_utf8($resp);
        if ( $resp =~ m{
                
\s*

(.*?)

\s*
}xms ) { $resp = $1; $resp =~ s{
}{}gxms; $resp =~ s{ \n{2,} }{ \n }gxms; # strip disclaimer $resp =~ s{ \A .*? Domain \s+ Information \n }{}xms; if ( $resp =~ /Status: \s+ Not \s+ Registered/ixms ) { return 0; } } else { return 0; } } elsif ( $tld eq 'tj' && $url =~ m|\.nic\.tj/cgi/lookup| ) { $resp = decode_utf8( $resp ); if ($resp =~ m|\n?(.+?)\n?|s) { $resp = $1; return 0 if $resp =~ m|may be available|s; $resp =~ s|\n\s+|\n|sg; $resp =~ s|\s+\n|\n|sg; $resp =~ s|\n\n|\n|sg; $resp =~ s|\n(.+?)\n
|s) { $resp = $1; $resp =~ s|||ig; $resp =~ s|| |ig; $resp =~ s|||ig; $resp =~ s|||ig; $resp =~ s|«|"|ig; $resp =~ s|»|"|ig; $resp =~ s| | |ig; $resp =~ s|\n\s+|\n|sg; $resp =~ s|\s+\n|\n|sg; $resp =~ s|\n\n|\n|sg; } else { return 0; } } else { return 0; } return $resp; } # check, if it's IP-address? sub is_ipaddr { $_[0] =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/; } # check, if it's IPv6-address? sub is_ip6addr { $_[0] =~ /^[0-9a-f]{1,4}:[0-9a-f]{1,4}:[0-9a-f:]+$/i; } # get domain level sub domain_level { my ($str) = @_; my $dotcount = $str =~ tr/././; return $dotcount + 1; } # split domain on name and TLD sub split_domain { my ($dom) = @_; my $tld = get_dom_tld( $dom ); my $name; if (uc $tld eq 'IP' || $tld eq 'NOTLD') { $name = $dom; } else { $dom =~ /(.+?)\.$tld$/; # or die "Can't match $tld in $dom"; $name = $1; } return ($name, $tld); } # sub dlen { my ($str) = @_; return length($str) * domain_level($str); } # clear the data's taintedness sub untaint (\$) { my ($str) = @_; $$str =~ m/^(.*)$/; $$str = $1; } 1; Net-Whois-Raw-2.43/lib/Net/Whois/Raw/Data.pm000444000000000000 21204712014615151 21061 0ustar00unknownunknown000000000000package Net::Whois::Raw::Data; # Use string as is no utf8; use strict; our @www_whois = qw( VN AC TJ CM ); # Candidates for www_whois: DO, IO, MG, SH, TM, TP, ZA our %servers = qw( RU whois.ripn.net SU whois.ripn.net XN--P1AI whois.ripn.net COM.RU whois.nic.ru NET.RU whois.nic.ru ORG.RU whois.nic.ru PP.RU whois.nic.ru RU.NET whois.nic.ru INT.RU whois.int.ru ABKHAZIA.SU whois.nic.ru ADYGEYA.RU whois.nic.ru ADYGEYA.SU whois.nic.ru AKTYUBINSK.SU whois.nic.ru AMURSK.RU whois.nic.ru ARKHANGELSK.SU whois.nic.ru ARMENIA.SU whois.nic.ru ASHGABAD.SU whois.nic.ru AZERBAIJAN.SU whois.nic.ru BALASHOV.SU whois.nic.ru BASHKIRIA.RU whois.nic.ru BASHKIRIA.SU whois.nic.ru BELGOROD.RU whois.nic.ru BELGOROD.SU whois.nic.ru BIR.RU whois.nic.ru BRYANSK.SU whois.nic.ru BUKHARA.SU whois.nic.ru CBG.RU whois.nic.ru CHELYABINSK.RU whois.nic.ru CHIMKENT.SU whois.nic.ru CMW.RU whois.nic.ru DAGESTAN.RU whois.nic.ru DAGESTAN.SU whois.nic.ru DUDINKA.RU whois.nic.ru EAST-KAZAKHSTAN.SU whois.nic.ru EXNET.SU whois.nic.ru FAREAST.RU whois.nic.ru GEORGIA.SU whois.nic.ru GROZNY.RU whois.nic.ru GROZNY.SU whois.nic.ru IVANOVO.SU whois.nic.ru JAMBYL.SU whois.nic.ru JAR.RU whois.nic.ru JOSHKAR-OLA.RU whois.nic.ru KALMYKIA.RU whois.nic.ru KALMYKIA.SU whois.nic.ru KALUGA.SU whois.nic.ru KARACOL.SU whois.nic.ru KARAGANDA.SU whois.nic.ru KARELIA.SU whois.nic.ru KCHR.RU whois.nic.ru KHAKASSIA.SU whois.nic.ru KOMI.SU whois.nic.ru KRASNODAR.SU whois.nic.ru KURGAN.SU whois.nic.ru KUSTANAI.RU whois.nic.ru KUSTANAI.SU whois.nic.ru MANGYSHLAK.SU whois.nic.ru MARINE.RU whois.nic.ru MORDOVIA.RU whois.nic.ru MORDOVIA.SU whois.nic.ru MSK.RU whois.nic.ru MSK.SU whois.nic.ru MURMANSK.SU whois.nic.ru MYTIS.RU whois.nic.ru NALCHIK.RU whois.nic.ru NALCHIK.SU whois.nic.ru NAVOI.SU whois.nic.ru NNOV.RU whois.nnov.ru NORILSK.RU whois.nic.ru NORTH-KAZAKHSTAN.SU whois.nic.ru NOV.RU whois.nic.ru NOV.SU whois.nic.ru OBNINSK.SU whois.nic.ru PALANA.RU whois.nic.ru PENZA.SU whois.nic.ru POKROVSK.SU whois.nic.ru PYATIGORSK.RU whois.nic.ru RU.NET whois.nic.ru SIMBIRSK.RU whois.nic.ru SOCHI.SU whois.nic.ru SPB.RU whois.nic.ru SPB.SU whois.nic.ru TASHKENT.SU whois.nic.ru TERMEZ.SU whois.nic.ru TOGLIATTI.SU whois.nic.ru TROITSK.SU whois.nic.ru TSARITSYN.RU whois.nic.ru TSELINOGRAD.SU whois.nic.ru TULA.SU whois.nic.ru TUVA.SU whois.nic.ru VLADIKAVKAZ.RU whois.nic.ru VLADIKAVKAZ.SU whois.nic.ru VLADIMIR.RU whois.nic.ru VLADIMIR.SU whois.nic.ru VOLOGDA.SU whois.nic.ru YAKUTIA.SU whois.nic.ru YEKATERINBURG.RU whois.nic.ru NS whois.nsiregistry.net RIPE whois.ripe.net IP whois.arin.net AERO whois.aero ARPA whois.iana.org ASIA whois.nic.asia BIZ whois.biz CAT whois.cat CC ccwhois.verisign-grs.com COM whois.crsnic.net COOP whois.nic.coop EDU whois.educause.edu GOV whois.dotgov.gov INFO whois.afilias.net INT whois.iana.org JOBS jobswhois.verisign-grs.com MIL whois.nic.mil MOBI whois.dotmobiregistry.net MUSEUM whois.museum NAME whois.nic.name NET whois.crsnic.net ORG whois.pir.org PRO whois.registrypro.pro TEL whois-tel.neustar.biz TRAVEL whois.nic.travel TV tvwhois.verisign-grs.com WS whois.worldsite.ws NF whois.nic.cx AC whois.nic.ac AG whois.nic.ag AM whois.amnic.net AS whois.nic.as AT whois.nic.at AU whois.aunic.net BE whois.dns.be BG whois.register.bg BJ whois.nic.bj BR whois.registro.br CA whois.cira.ca CD whois.nic.cd CH whois.nic.ch CI whois.nic.ci CL Whois.nic.cl CN whois.cnnic.net.cn CO whois.nic.co CX whois.nic.cx CZ whois.nic.cz DE whois.denic.de DK whois.dk-hostmaster.dk DM whois.nic.dm EE whois.eenet.ee EU whois.eu FI whois.ficora.fi FM whois.nic.fm FO whois.ripe.net FR whois.nic.fr GD whois.adamsnames.tc GG whois.channelisles.net GI whois2.afilias-grs.net GS whois.nic.gs GY whois.registry.gy HU whois.nic.hu HK whois.hkirc.hk HM whois.registry.hm HN whois2.afilias-grs.net HT whois.nic.ht IE whois.domainregistry.ie IL whois.isoc.org.il IM whois.nic.im IN whois.inregistry.net IO whois.nic.io IR whois.nic.ir IS whois.isnic.is IT whois.nic.it JE whois.channelisles.net JP whois.jprs.jp KE whois.kenic.or.ke KG whois.domain.kg KI whois.nic.ki KR whois.nic.or.kr KZ whois.nic.kz LA whois.nic.la LC whois2.afilias-grs.net LI whois.nic.li LT whois.domreg.lt LU whois.dns.lu LV whois.nic.lv LY whois.nic.ly MA whois.iam.net.ma MC whois.ripe.net MD whois.nic.md ME whois.nic.me MG whois.nic.mg MN whois2.afilias-grs.net MS whois.nic.ms MU whois.nic.mu MX whois.nic.mx MY whois.mynic.net.my NA whois.na-nic.com.na NL whois.domain-registry.nl NO whois.norid.no NU whois.nic.nu NZ whois.srs.net.nz PL whois.dns.pl PM whois.nic.pm PR whois.nic.pr PT whois.dns.pt RE whois.nic.re RO whois.rotld.ro RS whois.rnids.rs SA whois.saudinic.net.sa SB whois.nic.sb SC whois2.afilias-grs.net SE whois.iis.se SG whois.nic.net.sg SH whois.nic.sh SI whois.arnes.si SK whois.sk-nic.sk SM whois.ripe.net ST whois.nic.st TC whois.adamsnames.tc TF whois.nic.tf TH whois.nic.uk TK whois.dot.tk TL whois.nic.tl TM whois.nic.tm TO whois.tonic.to TR whois.nic.tr TW whois.twnic.net.tw UA whois.com.ua NET.UA whois.net.ua UK whois.nic.uk US whois.nic.us UZ whois.cctld.uz VC whois2.afilias-grs.net VE whois.nic.ve VG whois.adamsnames.tc WF whois.nic.wf YT whois.nic.yt ASN.AU whois.aunic.net COM.AU whois.aunic.net CONF.AU whois.aunic.net CSIRO.AU whois.aunic.net EDU.AU whois.aunic.net GOV.AU whois.aunic.net ID.AU whois.aunic.net INFO.AU whois.aunic.net NET.AU whois.aunic.net ORG.AU whois.aunic.net EMU.ID.AU whois.aunic.net WATTLE.ID.AU whois.aunic.net ADM.BR whois.nic.br ADV.BR whois.nic.br AGR.BR whois.nic.br AM.BR whois.nic.br ARQ.BR whois.nic.br ART.BR whois.nic.br ATO.BR whois.nic.br BIO.BR whois.nic.br BMD.BR whois.nic.br CIM.BR whois.nic.br CNG.BR whois.nic.br CNT.BR whois.nic.br COM.BR whois.nic.br ECN.BR whois.nic.br EDU.BR whois.nic.br ENG.BR whois.nic.br ESP.BR whois.nic.br ETC.BR whois.nic.br ETI.BR whois.nic.br FAR.BR whois.nic.br FM.BR whois.nic.br FND.BR whois.nic.br FOT.BR whois.nic.br FST.BR whois.nic.br G12.BR whois.nic.br GGF.BR whois.nic.br GOV.BR whois.nic.br IMB.BR whois.nic.br IND.BR whois.nic.br INF.BR whois.nic.br JOR.BR whois.nic.br LEL.BR whois.nic.br MAT.BR whois.nic.br MED.BR whois.nic.br MIL.BR whois.nic.br MUS.BR whois.nic.br NET.BR whois.nic.br NOM.BR whois.nic.br NOT.BR whois.nic.br NTR.BR whois.nic.br ODO.BR whois.nic.br OOP.BR whois.nic.br ORG.BR whois.nic.br PPG.BR whois.nic.br PRO.BR whois.nic.br PSC.BR whois.nic.br PSI.BR whois.nic.br QSL.BR whois.nic.br REC.BR whois.nic.br SLG.BR whois.nic.br SRV.BR whois.nic.br TMP.BR whois.nic.br TRD.BR whois.nic.br TUR.BR whois.nic.br TV.BR whois.nic.br VET.BR whois.nic.br ZLG.BR whois.nic.br AC.CN whois.cnnic.net.cn AH.CN whois.cnnic.net.cn BJ.CN whois.cnnic.net.cn COM.CN whois.cnnic.net.cn CQ.CN whois.cnnic.net.cn FJ.CN whois.cnnic.net.cn GD.CN whois.cnnic.net.cn GOV.CN whois.cnnic.net.cn GS.CN whois.cnnic.net.cn GX.CN whois.cnnic.net.cn GZ.CN whois.cnnic.net.cn HA.CN whois.cnnic.net.cn HB.CN whois.cnnic.net.cn HE.CN whois.cnnic.net.cn HI.CN whois.cnnic.net.cn HK.CN whois.cnnic.net.cn HL.CN whois.cnnic.net.cn HN.CN whois.cnnic.net.cn JL.CN whois.cnnic.net.cn JS.CN whois.cnnic.net.cn JX.CN whois.cnnic.net.cn LN.CN whois.cnnic.net.cn MO.CN whois.cnnic.net.cn NET.CN whois.cnnic.net.cn NM.CN whois.cnnic.net.cn NX.CN whois.cnnic.net.cn ORG.CN whois.cnnic.net.cn QH.CN whois.cnnic.net.cn SC.CN whois.cnnic.net.cn SD.CN whois.cnnic.net.cn SH.CN whois.cnnic.net.cn SN.CN whois.cnnic.net.cn SX.CN whois.cnnic.net.cn TJ.CN whois.cnnic.net.cn TW.CN whois.cnnic.net.cn XJ.CN whois.cnnic.net.cn XZ.CN whois.cnnic.net.cn YN.CN whois.cnnic.net.cn ZJ.CN whois.cnnic.net.cn AC.FJ whois.domains.fj BIZ.FJ whois.domains.fj COM.FJ whois.domains.fj INFO.FJ whois.domains.fj MIL.FJ whois.domains.fj NAME.FJ whois.domains.fj NET.FJ whois.domains.fj ORG.FJ whois.domains.fj PRO.FJ whois.domains.fj CO.GY whois.registry.gy COM.GY whois.registry.gy NET.GY whois.registry.gy COM.HK whois.hknic.net.hk GOV.HK whois.hknic.net.hk NET.HK whois.hknic.net.hk ORG.HK whois.hknic.net.hk AC.JP whois.jprs.jp AD.JP whois.jprs.jp CO.JP whois.jprs.jp GR.JP whois.jprs.jp NE.JP whois.jprs.jp OR.JP whois.jprs.jp AC.MA whois.iam.net.ma CO.MA whois.iam.net.ma GOV.MA whois.iam.net.ma NET.MA whois.iam.net.ma ORG.MA whois.iam.net.ma PRESS.MA whois.iam.net.ma COM.MX whois.nic.mx GOB.MX whois.nic.mx NET.MX whois.nic.mx COM.MT whois.nic.mt ORG.MT whois.nic.mt NET.MT whois.nic.mt EDU.MT whois.nic.mt CO.RS whois.rnids.rs ORG.RS whois.rnids.rs IN.RS whois.rnids.rs EDU.RS whois.rnids.rs COM.TW whois.twnic.net IDV.TW whois.twnic.net NET.TW whois.twnic.net ORG.TW whois.twnic.net COM.UA whois.com.ua ORG.UA whois.com.ua BIZ.UA whois.biz.ua CO.UA whois.co.ua PP.UA whois.pp.ua KIEV.UA whois.com.ua DN.UA whois.dn.ua LG.UA whois.lg.ua OD.UA whois.od.ua IN.UA whois.in.ua AC.UK whois.ja.net CO.UK whois.nic.uk GOV.UK whois.ja.net LTD.UK whois.nic.uk NET.UK whois.nic.uk ORG.UK whois.nic.uk PLC.UK whois.nic.uk XN--P1AG ru.whois.i-dns.net XN--P1AG ru.whois.i-dns.net XN--J1AEF whois.i-dns.net XN--E1APQ whois.i-dns.net XN--C1AVG whois.i-dns.net EU.COM whois.centralnic.com GB.COM whois.centralnic.com KR.COM whois.centralnic.com US.COM whois.centralnic.com QC.COM whois.centralnic.com DE.COM whois.centralnic.com NO.COM whois.centralnic.com HU.COM whois.centralnic.com JPN.COM whois.centralnic.com UY.COM whois.centralnic.com ZA.COM whois.centralnic.com BR.COM whois.centralnic.com CN.COM whois.centralnic.com SA.COM whois.centralnic.com SE.COM whois.centralnic.com UK.COM whois.centralnic.com RU.COM whois.centralnic.com GB.NET whois.centralnic.com UK.NET whois.centralnic.com SE.NET whois.centralnic.com AE.ORG whois.centralnic.com ORG.NS whois.pir.org BIZ.NS whois.biz NAME.NS whois.nic.name SO whois.nic.so BZ whois.enom.com XXX whois.nic.xxx ); our %ip_whois_servers = qw( AFRINIC whois.afrinic.net APNIC whois.apnic.net ARIN whois.arin.net LACNIC whois.lacnic.net RIPE whois.ripe.net JPNIC whois.nic.ad.jp KRNIC whois.krnic.net ); # for not utf8 our %codepages = ( 'whois.nic.cl' => 'iso-8859-1', 'whois.ttpia.com' => 'iso-8859-1', 'whois.registro.br' => 'iso-8859-1', 'whois.cira.ca' => 'iso-8859-1', 'whois.denic.de' => 'iso-8859-1', 'whois.eenet.ee' => 'iso-8859-1', 'whois.ficora.fi' => 'iso-8859-1', 'whois.isnic.is' => 'iso-8859-1', 'whois.nic.hu' => 'iso-8859-1', 'whois.dns.pt' => 'iso-8859-1', 'whois.net.ua' => 'koi8-u', 'whois.com.ua' => 'koi8-u', 'whois.biz.ua' => 'koi8-u', 'whois.co.ua' => 'koi8-u', 'whois.dn.ua' => 'koi8-u', 'whois.lg.ua' => 'koi8-u', 'whois.od.ua' => 'koi8-u', 'whois.in.ua' => 'koi8-u', 'whois.jprs.jp' => 'iso-2022-jp', 'whois.nic.or.kr' => 'euc-kr', 'whois.domain.kg' => 'cp-1251', ); our %notfound = ( 'whois.arin.net' => '^No match found', 'whois.ripe.net' => 'No entries found', 'whois.ripn.net' => 'No entries found', 'whois.nic.ru' => 'No entries found', 'whois.nnov.ru' => 'No entries found', 'whois.int.ru' => 'No entries found', 'whois.reg.ru' => '^Domain \S+ not found', 'whois.com.ua' => 'No entries found for', 'whois.co.ua' => 'No entries found', 'whois.biz.ua' => 'No entries found', 'whois.net.ua' => 'No entries found for domain', 'delta.hostmaster.net.ua' => 'No entries found for domain', 'whois.pp.ua' => 'No entries found', 'whois.dn.ua' => 'No match record found', 'whois.lg.ua' => 'No match record found', 'whois.od.ua' => 'No match record found', 'whois.in.ua' => 'No records found', 'whois.aero' => '^NOT FOUND', 'whois.nic.asia' => '^NOT FOUND', 'whois.biz' => '^Not found:', 'whois-tel.neustar.biz' => '^Not found', 'whois.cat' => '^% Object \S+ NOT FOUND', 'whois.nic.coop' => 'No domain records', 'whois.educause.edu' => '^No Match', 'whois.nic.mil' => '^No match for', 'whois.museum' => '^% Object \S+ NOT FOUND', 'whois.afilias.net' => '^NOT FOUND', 'whois.crsnic.net' => '^No match for', 'whois.networksolutions.com' => '(?i)no match', 'whois.dotmobiregistry.net' => '^NOT FOUND', 'whois.nic.name' => '^No match', 'whois.iana.org' => '^Domain \S+ not found', 'whois.pir.org' => '^NOT FOUND', 'ccwhois.verisign-grs.com' => '^No match for', 'jobswhois.verisign-grs.com' => '^No match for', 'tvwhois.verisign-grs.com' => '^No match for', 'whois.registrypro.pro' => '^No match', 'whois.worldsite.ws' => 'No match for', 'whois.nic.travel' => 'Not found: \S+', 'whois.nic.ag' => 'NOT FOUND', 'whois.nic.as' => 'Domain Not Found', 'whois.nic.at' => 'nothing found', 'whois.nic.br' => '^% No match for domain', 'whois.amnic.net' => 'No match', 'whois.aunic.net' => 'No Data Found', 'whois.dns.be' => '^Status:\s+FREE', 'whois.register.bg' => '^Domain name \S+ does not exist', 'whois.registro.br' => 'No match for', 'whois.registry.hm' => 'Domain not found', 'whois.nic.ht' => 'Status: Not Registered', 'whois.cira.ca' => '^Domain status\:\s+available', 'whois.nic.cd' => 'Domain Not Found', 'whois.nic.ch' => '^We do not have an entry in our database matching your', 'whois.nic.ci' => '^Domain \S+ not found', 'whois.nic.cl' => '\: no existe', 'whois.nic.cx' => 'Status\: Not Registered', 'whois.nic.cz' => '^\% No entries found.', 'whois.denic.de' => 'Status\: free', 'whois.nic.dm' => 'Status\: Not Registered', 'whois.dk-hostmaster.dk' => '^No entries found for', 'whois.eenet.ee' => '^\% No entries found', 'whois.eu' => '^Status:\s+AVAILABLE', 'whois.ficora.fi' => 'Domain not found', 'whois.domains.fj' => 'The domain \S+ was not found', 'whois.nic.fm' => 'Status: Not Registered', 'whois.nic.fr' => 'No entries found', 'whois.channelisles.net' => 'No information found', 'whois.nic.gs' => 'Status: Not Registered', 'whois.registry.gy' => 'Status\:\s+Not Registered', 'whois.hkirc.hk' => '^The domain has not been registered', 'whois.hknic.net.hk' => 'Domain Not Found', 'whois.nic.hu' => 'No match', 'whois.domainregistry.ie' => '^\% Not Registered', 'whois.isoc.org.il' => 'No data was found', 'whois.nic.im' => 'The domain \S+ was not found', 'whois.inregistry.net' => 'NOT FOUND', 'whois.nic.io' => 'Domain \S+ - Available', 'whois.isnic.is' => 'No entries found', 'whois.nic.it' => 'Status:\s+AVAILABLE', 'whois.nic.ir' => 'No entries found', 'whois.jprs.jp' => 'No match', 'whois.kenic.or.ke' => 'No match found', 'whois.nic.ki' => 'Status: Not Registered', 'whois.nic.or.kr' => 'Above domain name is not registered', 'whois.nic.kz' => 'Nothing found for this query', 'whois.nic.la' => 'DOMAIN NOT FOUND', 'whois.nic.li' => 'We do not have an entry', 'whois.domreg.lt' => '^Status:\s+available', 'whois.dns.lu' => 'No such domain', 'whois.nic.lv' => 'Status\: free', 'whois.nic.ly' => 'Not found', 'whois.iam.net.ma' => 'No Objects Found', 'whois.nic.md' => 'No match for', 'whois.nic.me' => 'NOT FOUND', 'whois.nic.mg' => 'Status\: Not Registered', 'whois.nic.ms' => 'Status\: Not Registered', 'whois.nic.mt' => 'Domain is not registered', 'whois.nic.mu' => 'Status\: Not Registered', 'whois.nic.mx' => 'Object_Not_Found', 'whois.mynic.net.my' => '^Domain Name \S+ does not', 'whois.na-nic.com.na' => '^Status\: Not Registered', 'whois.domain-registry.nl' => '^\S+ is free', 'whois.norid.no' => '^\% No match', 'whois.nic.nu' => '^NO MATCH for domain', 'whois.srs.net.nz' => '^query_status\: (500 Invalid|220 Avail)', 'whois.dns.pl' => 'No information available about domain name', 'whois.nic.pm' => 'No entries found', 'whois.nic.pr' => 'is available for registration', 'whois.dns.pt' => 'no match', 'whois.nic.re' => 'No entries found', 'whois.rotld.ro' => 'No entries found', 'whois.rnids.rs' => 'Domain is not registered', 'whois.saudinic.net.sa' => 'No Match for', 'whois.nic.sb' => 'Status: Not Registered', 'whois.iis.se' => '^\S+ not found', 'whois.nic.net.sg' => '^Domain Not Found', 'whois.nic.sh' => '^Domain \S+ - Available', 'whois.arnes.si' => 'No entries found', 'whois.nic.st' => '^No entries found', 'whois.adamsnames.tc' => '^\S+ is not registered', 'whois.adamsnames.com' => '^\S+ is not registered', 'whois.nic.tl' => 'Status\: Not Registered', 'whois.nic.tf' => 'No entries found', 'whois.dot.tk' => 'domain name not known', 'whois.nic.tm' => '^Domain \S+ - Available', 'whois.tonic.to' => 'No match for', 'whois.twnic.net' => 'No Found', 'whois.twnic.net.tw' => '^No Found', 'whois.nic.uk' => 'No match for', 'whois.ja.net' => '^No such domain', 'whois.nic.us' => '^Not found', 'whois.cctld.uz' => 'not found in database', 'whois.nic.ve' => 'No match for', 'whois.nic.wf' => 'No entries found', 'whois.nic.yt' => 'No entries found', 'whois.nsiregistry.net' => 'No match for', 'whois.007names.com' => '^The Domain Name \S+ does not exist', 'whois.0101domain.com' => 'No match for domain', 'whois.1stdomain.net' => '^No domain found', 'whois.123registration.com' => '^No match for', # 'whois.1isi.com' -- empty on not fount # 'whois.35.com' -- empty on not fount 'whois.4domains.com' => 'Domain Not Found', # Answer on first query -- "Please try again in 4 seconds" 'whois.activeregistrar.com' => '^Domain name not found', 'whois.addresscreation.com' => '^No match for', # 'whois.advantage-interactive.com' -- show empty fields 'whois2.afilias-grs.net' => '^NOT FOUND', 'whois.aitdomains.com' => '^No match for', 'whois.alldomains.com' => '^No match for', 'whois.centralnic.com' => '^This domain name may be available for', 'whois.communigal.net' => '^NOT FOUND', 'whois.desertdevil.com' => 'No match for domain', 'whois.directi.com' => 'No Match for', 'whois.directnic.com' => '^No match for', 'whois.domaindiscover.com' => '^No match for', 'whois.domainstobeseen.com' => 'No match for', 'whois.dotregistrar.com' => '^No match for', 'whois.dotster.com' => 'No match for', 'whois.ename.com' => 'Out of Registry', 'whois.enameco.com' => 'No match for', 'whois.gandi.net' => 'Not found', 'whois.gdns.net' => '^Domain Not Found', 'whois.getyername.com' => '^No match for', 'whois.godaddy.com' => '^No match for', 'whois.joker.com' => 'object\(s\) not found', 'whois.markmonitor.com' => 'No entries found', 'whois.melbourneit.com' => '^Invalid/Unsupported whois name check', 'whois.moniker.com' => '^No Match', 'whois.names4ever.com' => '^No match for', # 'whois.namesbeyond.com' ??? my IP in black list 'whois.nameisp.com' => 'domain not found', # 'whois.namescout.com' -- need big timeout 'whois.namesystem.com' => '^Sorry, Domain does not exist', 'whois.nordnet.net' => 'No match for', 'whois.paycenter.com.cn' => 'no data found', 'whois.pir.net' => 'NOT FOUND', 'whois.plisk.com' => 'No match for', 'whois.publicdomainregistry.com' => 'No match for', 'whois.regtime.net' => 'Domain \S+ not found', 'whois.schlund.info' => '^Domain \S+ is not registered here', 'whois.thnic.net' => 'No entries found', 'whois.tucows.com' => '^Can.t get information on non-local domain', 'whois.ttpia.com' => 'No match for', 'whois.worldnames.net' => 'NO MATCH for domain', # 'whois.yournamemonkey.com' -- need try again 'whois.cnnic.net.cn' => 'no matching record', 'whois.nic.co' => 'Not found: \S+', 'me.whois-servers.net' => 'NOT FOUND', 'whois.domain.kg' => 'Data not found. This domain is available for registration.', 'whois.nic.so' => 'Not\s+found:', # for VN | TJ | CM zones 'www_whois' => '(Available|no records found|is free|Not Registered)', 'whois.nic.xxx' => 'NOT FOUND', ); our %strip = ( 'whois.arin.net' => [ '^The ARIN Registration Services Host contains', '^Network Information:.*Networks', '^Please use the whois server at', '^Information and .* for .* Information.', ], 'whois.ripe.net' => [ '^%', ], 'whois.ripn.net' => [ '^%', 'Last updated on ', ], 'whois.aero' => [ '^Access to \.AERO WHOIS', '^determining the contents', '^Afilias registry database', '^Afilias Limited for informational', '^guarantee its accuracy', '^access\. You agree that', '^and that, under no', '^enable, or otherwise support', '^facsimile of mass unsolicited', '^to entities other than the', '^\(b\) enable high volume', '^queries or data to the systems', '^Afilias except as reasonably', '^modify existing registrations', '^the right to modify these terms', '^you agree to abide by this policy', '^Name Server: $', ], 'whois.nic.asia' => [ '^DotAsia WHOIS LEGAL STATEMENT AND', '^by DotAsia and the access to', '^for information purposes only', '^domain name is still available', '^the registration records of', '^circumstances, be held liable', '^be wrong, incomplete, or not', '^you agree not to use the', '^otherwise support the transmission', '^other solicitations whether via', '^possible way; or to cause nuisance', '^sending \(whether by automated', '^volumes or other possible means', '^above, it is explicitly forbidden', '^in any form and by any means', '^quantitatively or qualitatively', '^database without prior and explicit', '^hereof, or to apply automated', '^You agree that any reproduction', '^purposes will always be considered', '^the content of the WHOIS database', '^by this policy and accept that', '^WHOIS services in order to protect', '^integrity of the database', '^Nameservers: $', ], 'whois.biz' => [ '^>>>> Whois database was last updated', '^NeuLevel, Inc\., the Registry', '^for the WHOIS database through', '^is provided to you for', '^persons in determining contents', '^NeuLevel registry database', '^"as is" and does not guarantee', '^agree that you will use this', '^circumstances will you use', '^support the transmission of', '^solicitations via direct mail', '^contravention of any applicable', '^enable high volume, automated', '^\(or its systems\)\. Compilation', '^WHOIS database in its entirety', '^allowed without NeuLevel', '^right to modify or change these', '^subsequent notification of any kind', '^whatsoever, you agree to abide by', '^NOTE\: FAILURE TO LOCATE A RECORD', '^OF THE AVAILABILITY OF A DOMAIN NAME', '^NeuStar, Inc\., the Registry', '^NeuStar registry database', '^allowed without NeuStar', ], 'whois-tel.neustar.biz' => [ # .tel '^>>>> Whois database was last updated', 'Telnic, Ltd., the Registry Operator', 'for the WHOIS database through an', 'is provided to you for informational', 'persons in determining contents of a', 'Telnic registry database. Telnic makes', '"as is" and does not guarantee its', 'agree that you will use this data', 'circumstances will you use this data', 'support the transmission of mass', 'solicitations via direct mail,', 'contravention of any applicable', 'enable high volume, automated,', '\(or its systems\). Compilation,', 'WHOIS database in its entirety,', 'allowed without Telnic\'s prior', 'right to modify or change these', 'subsequent notification of any', 'whatsoever, you agree to abide', 'Contact information: Disclosure', 'of UK and EU Data Protection', 'contact ID may be available by', 'system. The information can also', 'Special Access Service. Visit', '.TEL WHOIS DISCLAIMER AND TERMS', 'By submitting a query and/or', 'agree to these terms and', 'This whois information is', 'Telnic operates the Registry', 'is provided for information', 'and shall have no liability', 'inaccurate.', 'Telnic is the owner of all', 'that is made available via this', 'the information you obtain from', 'than to obtain information about', 'for registration or to obtain the', 'of a domain name that is already', 'utilise, combine or compile any', 'to produce a list or database', 'a license from Telnic to do so.', 'reason, you will destroy all', 'using this whois service.', 'You must not use the information', 'to: \(a\) allow, enable or otherwise', 'unsolicited commercial advertising', '\(b\) harass any person; or', ], 'whois.cat' => [ '^%', ], 'ccwhois.verisign-grs.com' => [ # .CC '^>>> Last update of', '^NOTICE\: The expiration date', 'sponsorship of the domain name', '^currently set to expire', '^expiration date of the', '^sponsoring registrar\. Users', '^Whois database to view the', '^for this registration', '^TERMS OF USE\: You are', '^database through the use', '^automated except as reasonably', '^modify existing registrations', '^database is provided by', '^assist persons in obtaining', '^registration record\. VeriSign does', '^By submitting a Whois query', '^use\: You agree that you may use', '^under no circumstances will you', '^otherwise support the transmission', '^advertising or solicitations via', '^\(2\) enable high volume, automated', '^VeriSign \(or its computer systems\)', '^dissemination or other use of this', '^the prior written consent of', '^processes that are automated and', '^Whois database except as reasonably', '^or modify existing registrations', '^your access to the Whois database', '^operational stability\. VeriSign', '^Whois database for failure to', '^reserves the right to modify', '^The Registry database contains', '^and Registrars\.', ], 'whois.networksolutions.com' => [ # for .net '^NOTICE AND TERMS OF USE', '^database through the use', '^Data in Network Solutions', '^purposes only, and to assist', '^to a domain name registration', '^By submitting a WHOIS query', '^You agree that you may use', '^circumstances will you use', '^the transmission of mass', '^via e-mail, telephone, or', '^electronic processes that', '^compilation, repackaging', '^prohibited without the', '^high-volume, automated', '^database\. Network Solutions', '^database in its sole discretion', '^querying of the WHOIS database', '^Network Solutions reserves', '^Get a FREE domain name', '^http\:\/\/www\.network', '^Visit AboutUs\.org for', '^ [ '\.coop registry WHOIS', '^For help on using this', '^For more \.coop information', '^The domain records that match', '-----------', '^names only\. Although every', '^data, accuracy cannot be guaranteed', '^This service is intended only', '^use this data only for lawful', '^use this data to\: \(a\) allow', '^e-mail, telephone, or facsimile', '^solicitations to entities', '^customers; or \(b\) enable high', '^queries or data to the systems', '^Registrar, except as reasonably', '^existing registrations\. The', '^of this Data is expressly prohibited', '^dotCoop\. All rights reserved', '^at any time\. By submitting this', '^BY USING THE WHOIS SERVICE', '^GENERATED WITH RESPECT THERETO', '^ANY DAMAGES OF ANY KIND ARISING', '^INFORMATION PROVIDED BY THE WHOIS', '^THE RESULTS OF ANY WHOIS REPORT', '^CANNOT BE RELIED UPON IN CONTEMPLATION', '^VERIFICATION, NOR DO SUCH RESULTS', ], 'whois.educause.edu' => [ '^This Registry database', '^The data in the EDUCAUSE', '^by EDUCAUSE for information', '^assist in the process', '^or related to \.edu domain', '^The EDUCAUSE Whois database', '^\.EDU domain\.', '^A Web interface for the \.EDU', '^available at\: http', '^By submitting a Whois query', '^will not be used to allow', '^the transmission of unsolicited', '^solicitations via e-mail', '^harvest information from this', '^except as reasonably necessary', '^domain names\.', '^You may use \"%\" as a', '^information regarding the use', '^type\: help', ], 'whois.dotgov.gov' => [ '^% DOTGOV WHOIS Server ready', '^Please be advised that this whois server only', ], 'whois.nic.mil' => [ '^To single out one record', '^handle, shown in parenthesis', '^Please be advised that this whois', '^All INTERNET Domain, IP Network Number,', '^the Internet Registry, RS.INTERNIC.NET.', ], 'whois.dotmobiregistry.net' => [ # .mobi '^mTLD WHOIS LEGAL STATEMENT', '^by mTLD and the access to', '^for information purposes only.', '^domain name is still available', '^the registration records of', '^circumstances, be held liable', '^be wrong, incomplete, or not', '^you agree not to use the information', '^otherwise support the transmission', '^other solicitations whether via', '^possible way; or to cause', '^sending \(whether by automated,', '^volumes or other possible means\)', '^above, it is explicitly forbidden', '^in any form and by any means', '^quantitatively or qualitatively', '^database without prior and explicit', '^hereof, or to apply automated,', '^You agree that any reproduction', '^purposes will always be considered', '^the content of the WHOIS database.', '^by this policy and accept that mTLD', '^WHOIS services in order to protect', '^integrity of the database.', ], 'whois.museum' => [ '^%', ], 'whois.nic.name' => [ '^Disclaimer: The Global Name Registry', '^maintain the completeness', '^guarantee that', '^provided through', '^any warranties', '^HEREIN OR IN ANY', '^ACCEPTED THAT THE GLOBAL', '^ANY DAMAGES OF ANY KIND', '^REPORT OR THE INFORMATION', '^OMISSIONS OR MISSING', '^INFORMATION PROVIDED', '^CONTEMPLATION OF LEGAL', '^DO SUCH RESULTS CONSTITUTE', '^results of the Whois', '^conditions and limitations', '^lawful purposes, in particular', '^obligations\. Illegitimate uses', '^limited to, unsolicited email', '^other improper purpose', '^documented by The Global Name', '^for any commercial purpose', '^This is the \.name Tiered Access', '^string "help"\. A whois web', '^A full list of \.name', '^\s+--------', ], 'whois.afilias.net' => [ # .info '^Access to INFO WHOIS information', '^determining the contents of a', '^Afilias registry database', '^Afilias Limited for informational', '^guarantee its accuracy', '^access\. You agree that', '^and that, under no circumstances', '^enable, or otherwise support', '^facsimile of mass unsolicited', '^to entities other than the data', '^\(b\) enable high volume, automated', '^queries or data to the systems', '^Afilias except as reasonably', '^modify existing registrations', '^the right to modify these', '^you agree to abide by this policy', '^Name Server: $', ], 'whois.crsnic.net' => [ # .com main .net '^TERMS OF USE:', '^database through', '^automated except', '^modify existing', '^Services\' \(\"VeriSign\"\)', '^information purposes only', '^about or related to a', '^guarantee its accuracy\.', '^by the following terms', '^for lawful purposes and', '^to: (1) allow, enable,', '^unsolicited, commercial', '^or facsimile; or \(2\)', '^that apply to VeriSign', '^repackaging, dissemination', '^prohibited without the', '^use electronic processes', '^query the Whois database', '^domain names or modify', '^to restrict your access', '^operational stability\.', '^Whois database for', '^reserves the right', '^NOTICE AND TERMS OF USE:', '^Data in Network Solutions', '^purposes only, and to assist', '^to a domain name registration', '^By submitting a WHOIS query,', '^You agree that you may use', '^circumstances will you use', '^the transmission of mass', '^via e-mail, telephone, or', '^electronic processes that', '^compilation, repackaging,', '^high-volume, automated,', '^database. Network Solutions', '^database in its sole discretion,', '^querying of the WHOIS database', '^Network Solutions reserves the', '^NOTICE: The expiration date', '^registrar\'s sponsorship of', '^currently set to expire\.', '^date of the domain name', '^registrar. Users may', '^view the registrar\'s', '^to: \(1\) allow, enable,', '^The Registry database', '^Registrars\.', '^Domain not found locally,', '^Local WHOIS DB must be out', '^Whois Server Version', '^Domain names in the .com', '^with many different', '^for detailed information\.', '^>>> Last update of whois database', ], 'whois.iana.org' => [ '^q', ], 'whois.pir.org' => [ '^NOTICE\: Access to \.ORG WHOIS', '^determining the contents', '^registry database\. The data', '^for informational purposes', '^accuracy\. This service', '^that you will use this data', '^circumstances will you use', '^support the transmission by', '^unsolicited, commercial', '^the data recipient', '^automated, electronic processes', '^Registry Operator or any', '^necessary to register domain', '^rights reserved\. Public Interest', '^time\. By submitting this query', '^Name Server: $', ], 'whois.registrypro.pro' => [ '^Whois data provided by RegistryPro', '^RegistryPro Whois Terms of Use', '^Access to RegistryPro', '^is strictly limited to', '^guarantee the accuracy', '^only for lawful purposes', '^data to\: \(a\) allow, enable', '^telephone, or facsimile of', '^solicitations to entities', '^customer; or \(b\) enable', '^send queries or data to the', '^Operator or any ICANN-accredited', '^to register domain names or', '^reserves the right to modify', '^discretion\. Failure to adhere to', '^restriction or termination of', '^By submitting this query, you', '^All rights reserved\. RegistryPro', ], 'jobswhois.verisign-grs.com' => [ # .JOBS '^>>> Last update of', '^NOTICE\: The expiration date', 'sponsorship of the domain name', '^currently set to expire', '^expiration date of the', '^sponsoring registrar\. Users', '^Whois database to view the', '^for this registration', '^TERMS OF USE\: You are', '^database through the use', '^automated except as reasonably', '^modify existing registrations', '^database is provided by', '^assist persons in obtaining', '^registration record\. VeriSign does', '^By submitting a Whois query', '^use\: You agree that you may use', '^under no circumstances will you', '^otherwise support the transmission', '^advertising or solicitations via', '^\(2\) enable high volume, automated', '^VeriSign \(or its computer systems\)', '^dissemination or other use of this', '^the prior written consent of', '^processes that are automated and', '^Whois database except as reasonably', '^or modify existing registrations', '^your access to the Whois database', '^operational stability\. VeriSign', '^Whois database for failure to', '^reserves the right to modify', '^The Registry database contains', '^and Registrars\.', ], 'tvwhois.verisign-grs.com' => [ # .TV '^>>> Last update of', '^NOTICE\: The expiration date', 'sponsorship of the domain name', '^currently set to expire', '^expiration date of the', '^sponsoring registrar\. Users', '^Whois database to view the', '^for this registration', '^TERMS OF USE\: You are', '^database through the use', '^automated except as reasonably', '^modify existing registrations', '^database is provided by', '^assist persons in obtaining', '^registration record\. VeriSign does', '^By submitting a Whois query', '^use\: You agree that you may use', '^under no circumstances will you', '^otherwise support the transmission', '^advertising or solicitations via', '^\(2\) enable high volume, automated', '^VeriSign \(or its computer systems\)', '^dissemination or other use of this', '^the prior written consent of', '^processes that are automated and', '^Whois database except as reasonably', '^or modify existing registrations', '^your access to the Whois database', '^operational stability\. VeriSign', '^Whois database for failure to', '^reserves the right to modify', '^The Registry database contains', '^and Registrars\.', ], 'whois.enom.com' => [ # .TV .CC '^=-=-=-=', '^Visit AboutUs.org for more', '^ [ '^Welcome to the .* Whois Server', '^Use of this service for any', '^than determining the', '^in the .* to be registered', '^prohibited.', ], 'whois.nic.ag' => [ '^Access to CCTLD WHOIS', '^determining the contents', '^Afilias registry database', '^Afilias Limited for', '^guarantee its accuracy', '^access\. You agree that', '^and that, under no', '^enable, or otherwise', '^facsimile of mass', '^to entities other than', '^\(b\) enable high volume', '^queries or data to the', '^Afilias except as reasonably', '^modify existing registrations', '^the right to modify these', '^you agree to abide by this', '^Name Server: $', ], 'whois.nic.at' => [ '^%', ], 'whois.aunic.net' => [ # .au '^%', ], 'whois.dns.be' => [ '^%', ], 'whois.registro.br' => [ '^%', ], 'whois.cira.ca' => [ '^%', ], 'whois.nic.ch' => [ '^whois: This information is subject', '^See http', ], 'whois.nic.ci' => [ '^All rights reserved', '^Copyright \"Generic NIC', ], 'whois.nic.cl' => [ '^ACE\:', '^ltima modificacin', '\(Database last updated on\)', '^Ms informacin', 'www\.nic\.cl\/cgi-bin', '^Este mensajes est impreso', '^\(This message is printed', '^\s+\(\)$', ], 'whois.nic.cx' => [ '^TERMS OF USE\: You are not', '^CiiA makes every effort to maintain the completeness', 'CiiA, All rights reserved', '^Domain Information$', ], 'whois.nic.cz' => [ '^%', ], 'whois.denic.de' => [ '^%', ], 'whois.nic.dm' => [ '^TERMS OF USE\: You are not', '^database through the use', '^automated\. Whois database', '^community on behalf of', '^The data is for information', '^guarantee its accuracy', '^by the following terms of', '^for lawful purposes and that', '^to\: \(1\) allow, enable', '^unsolicited, commercial', '^or facsimile; or \(2', '^that apply to CoCCA it', '^compilation, repackaging,', '^expressly prohibited\.', '^CoCCA Helpdesk', '^Domain Information$', ], 'whois.eenet.ee' => [ '^The registry database contains', '^\.ORG\.EE and \.MED\.EE domains', '^Registrar\: EENET', '^URL\: http', ], 'whois.dk-hostmaster.dk' => [ '^#', ], 'whois.eu' => [ '^%', ], 'whois.ficora.fi' => [ '^More information is available', '^Copyright \(c\) Finnish', ], 'whois.nic.fr' => [ '^%%', ], 'whois.channelisles.net' => [ # .GG .JE '^status\:', '^The CHANNELISLES.NET', '^for domains registered', '^The WHOIS facility is', '^basis only\. Island Networks', '^or otherwise of information', '^the WHOIS, you accept this', '^Please also note that some', '^unavailable for registration', '^for a number of reasons', '^Other names for', '^nonetheless be unavailable', '^WHOIS database copyright', ], 'whois.hkirc.hk' => [ '^Whois server', '^Domain names in the', '^and .* can now be registered', '^Go to http://www.hkdnr.net.hk', '^---------', '^The Registry contains ONLY', '^.* and .*\\.HK domains.', ], 'whois2.afilias-grs.net' => [ # .GI .HN .LC .SC .VC '^Access to CCTLD WHOIS', '^determining the contents', '^Afilias registry database', '^Afilias Limited for', '^guarantee its accuracy', '^access\. You agree that', '^and that, under no', '^enable, or otherwise', '^facsimile of mass unsolicited', '^to entities other than', '^\(b\) enable high volume', '^queries or data to the', '^Afilias except as reasonably', '^modify existing registrations', '^the right to modify these', '^you agree to abide by this policy', '^Name Server: $', ], 'whois.nic.gs' => [ '^TERMS OF USE\: You are not', '^database through the use', '^automated\. Whois database', '^community on behalf of CoCCA', '^The data is for information', '^guarantee its accuracy', '^by the following terms', '^for lawful purposes and', '^to\: \(1\) allow, enable', '^unsolicited, commercial', '^or facsimile; or \(2\) enable', '^that apply to CoCCA it', '^compilation, repackaging', '^expressly prohibited', '^CoCCA Helpdesk', '^Domain Information$', ], 'whois.hkirc.hk' => [ '----------------', '^ Whois server by HKDNR', '^ Domain names in the \.com\.hk', '^ \.gov\.hk, idv\.hk\. and', '^ Go to http', '^ The Registry contains ONLY', '^WHOIS Terms of Use', '^By using this WHOIS', '^The data in HKDNR', '^You are not authorised to', '^You agree that you will', '^a\. use the data for', '^b\. enable high volume', '^c\. without the prior', '^d\. use such data', '^HKDNR in its sole discretion', '^HKDNR may modify these', '^Company Chinese name', # What is Code Page? ], 'whois.nic.hu' => [ '% Whois server', '^Rights restricted by', 'Legal usage of this', '^abide by the rules', '^http\:', 'A szolgaltatas csak a', '^elrhet felttelek', '^hasznlhat leglisan', ], 'whois.domainregistry.ie' => [ '^%', ], 'whois.isoc.org.il' => [ '^%', ], 'whois.inregistry.net' => [ # .IN '^Access to \.IN WHOIS', '^determining the contents', '^\.IN registry database', '^\.IN Registry for informational', '^guarantee its accuracy', '^access\. You agree', '^and that, under no', '^enable, or otherwise', '^facsimile of mass unsolicited', '^to entities other than', '^\(b\) enable high volume', '^queries or data to the', '^Afilias except as reasonably', '^modify existing registrations', '^the right to modify these', '^you agree to abide by this', '^Name Server: $', ], 'whois.isnic.is' => [ '^%', ], 'whois.nic.it' => [ '^\*', ], 'whois.jprs.jp' => [ '^\[\s', ], 'whois.kenic.or.ke' => [ '^%', '^remarks\:', ], 'whois.nic.or.kr' => [ '^Ӽ ̸ .kr ƴ ', ], 'whois.nic.kz' => [ '^Whois Server for the KZ', '^This server is maintained', ], 'whois.nic.li' => [ '^whois\: This information', '^See http', ], 'whois.domreg.lt' => [ '^%', ], 'whois.dns.lu' => [ '^%', ], 'whois.nic.lv' => [ '^%', ], 'whois.nic.ms' => [ '^TERMS OF USE\: You are not', '^database through the use', '^automated\.', '^The data is for information', '^guarantee its accuracy', '^by the following terms of', '^for lawful purposes and', '^to\: \(1\) allow, enable', '^unsolicited, commercial', '^or facsimile; or \(2\) enable', '^expressly prohibited', '^Domain Information$' ], 'whois.nic.mu' => [ '^TERMS OF USE\: You are not', '^Internet Direct Ltd makes every effort to maintain the completeness', 'Internet Direct Ltd, All rights reserved', '^Domain Information$', ], 'whois.nic.mx' => [ '^La informacion que ha', '^relacionados con la delegacion', '^administrado por NIC Mexico', '^Queda absolutamente prohibido', '^de Correos Electronicos no', '^de productos y servicios', '^de NIC Mexico\.', '^La base de datos generada', '^por las leyes de Propiedad', '^sobre la materia\.', '^Si necesita mayor informacion', '^comunicarse a ayuda@nic', '^Si desea notificar sobre correo', '^de enviar su mensaje a abuse', ], 'whois.mynic.net.my' => [ '^Welcome to \.my DOMAIN', '----------', 'For alternative search', 'whois -h whois\.domainregistry\.my', 'Type the command as below', 'Note\: Code is previously', 'Please note that the query limit is 500 per day from the same IP', # !!! 'SEARCH BY DOMAIN NAME', '^Disclaimer', '^MYNIC, the Registry for', '^database through a MYNIC-Accredited', '^you for informational purposes', '^determining contents of a', '^database\.', '^MYNIC makes this information', '^its accuracy\.', '^By submitting a WHOIS query', '^lawful purposes and that', '^\(1\) to allow, enable, or', 'commercial advertising or', '^\(2\) for spamming or', '^\(3\) to enable high volume', 'registry \(or its systems\) or', '^\(4\) for any other abusive purpose', '^Compilation, repackaging', '^its entirety, or of a substantial', "^MYNIC's prior written permission", '^these conditions at any time', '^kind\. By executing this query', '^these terms\.', '^NOTE\: FAILURE TO LOCATE', '^AVAILABILITY OF A DOMAIN NAME', '^All domain names are subject to', '^Registration of Domain Name', '^For details, please visit', ], 'whois.na-nic.com.na' => [ '^TERMS OF USE\: You are not', '^the use of electronic', '^WHOIS is NA-NiC', '^internet community\. The', '^its accuracy\. By submitting', '^lawful purposes and', '^enable, or otherwise support', '^advertising or solicitations', '^automated, electronic processes', '^member computer systems\). The', '^this Data is expressly prohibited', '^Copyright 1991, 1995 Dr Lisse', '^Domain Information$', ], 'whois.domain-registry.nl' => [ 'Record maintained by', 'Copyright notice', 'No part of this publication', 'retrieval system, or', 'mechanical, recording, or', 'Foundation for Internet', 'Registrars are bound by', 'except in case of reasonable', 'and solely for those business', 'terms and Conditions for', 'Any use of this material', 'similar activities is', 'Stichting Internet', 'of any such activities or', 'Copyright \(c\) The', 'Netherlands \(SIDN\)', '^These restrictions apply equally', '^reproductions and publications', '^reasonable, necessary and solely', '^activities referred to in the', '^Registrars', '^action. Anyone who is aware', '^in the Netherlands', '^\(SIDN\) Dutch Copyright Act', '^subsection 1, clause 1\).', ], 'whois.norid.no' => [ '^%', ], 'whois.nic.nu' => [ '------------', '^\.NU Domain Ltd', '^Owner and Administrative Contact information for', '^registered in \.nu is', '^Copyright by \.NU Domain', '^Database last updated', ], 'whois.srs.net.nz' => [ '^%', ], 'whois.dns.pl' => [ '^no option', '^WHOIS displays data with a', '^Registrant data available at', ], 'whois.nic.pm' => [ '^%%', ], 'whois.nic.pr' => [ '^Whois Disclaimer', '^The data in nic\.pr', '^purposes only, that is to', '^a domain name registration', '^and does not guarantee its', '^will use this data only for', '^you use this data to', '^mass unsolicited, commercial', '^mail, including spam or by', '^processes or robotic', '^purposes that apply to nic', '^nation or other use of this', '^consent of nic\.pr\. Nic', '^mitting this query, you', ], 'whois.nic.re' => [ '^%%', ], 'whois.rotld.ro' => [ '^%', ], 'whois.iis.se' => [ '^#', ], 'whois.nic.net.sg' => [ '----------', 'SGNIC WHOIS Server', '^The following data is', '^Registrant\:', '^Note\: With immediate effect', '^Contact will not be shown', '^Technical Contact details', '^Any party who has', '^contacts from the domain', '^using the organization', ], 'whois.nic.sh' => [ '^NIC Whois Server', ], 'whois.arnes.si' => [ '^%', ], 'whois.nic.st' => [ '^The data in the .* database is provided', '^The .* Registry does not guarantee', '^The data in the .* database is protected', '^By submitting a .* query, you agree that you will', '^The Domain Council of .* reserves the right', ], 'whois.nic.tf' => [ '^%%', ], 'whois.dot.tk' => [ 'Rights restricted by', 'http\:\/\/www\.dot\.tk', 'Your selected domain name', 'cancelled, suspended, refused', 'It may be available for', 'In the interim, the rights', 'transferred to Malo Ni', 'Please be advised that', 'Malo Ni Advertising', 'that was previously', 'Please review http', 'Due to restrictions in', 'about the previous', 'to the general public', 'Dot TK is proud to work', 'agencies to stop spam', 'other illicit content on', 'Dot TK Registry directly', 'usage of this domain by', 'Record maintained by', ], 'whois.tonic.to' => [ '^Tonic whoisd', ], 'whois.twnic.net.tw' => [ '^Registrar:', '^URL: http://rs.twnic.net.tw', ], 'whois.net.ua' => [ '^% This is the Ukrainian', '^% Rights restricted by', '^%$', '^% % \.UA whois', '^% ========', '% The object shown', '% It has been obtained', '^% \(whois\.', '^%$', '^% REDIRECT BEGIN', '^% REDIRECT END', ], 'whois.dn.ua' => [ '^%', ], 'whois.lg.ua' => [ '^%', ], 'whois.od.ua' => [ '^%', ], 'whois.com.ua' => [ '^% This is the Ukrainian', '^% Rights restricted', '^%$', '^% % .UA whois', '^% =====', ], 'whois.nic.uk' => [ '^This WHOIS information is', '^for \.uk domain names', 'Copyright Nominet UK 1996 - 2009', '^You may not access the', '^by the terms of use available', '^includes restrictions on', '^repackaging, recompilation', '^or hiding any or all of this', '^limits\. The data is provided', '^register\. Access may be withdrawn', 'WHOIS lookup made at', '^--', ], 'whois.nic.us' => [ '^>>>> Whois database was last', '^NeuStar, Inc\., the Registry', '^information for the WHOIS', '^This information is provided', '^designed to assist persons', '^registration record in the', '^information available to you', '^By submitting a WHOIS query', '^lawful purposes and that', '^\(1\) to allow, enable', '^unsolicited, commercial', '^electronic mail, or by telephone', '^data and privacy protection', '^electronic processes that', '^repackaging, dissemination', '^entirety, or of a substantial', 'prior written permission', '^change these conditions at', '^of any kind\. By executing', '^abide by these terms', '^NOTE\: FAILURE TO LOCATE A', '^OF THE AVAILABILITY', '^All domain names are subject', '^rules\. For details, please', ], 'whois.nic.wf' => [ '^%%', ], 'whois.nic.yt' => [ '^%%', ], 'whois.ename.com' => [ # add .com .net .edu '^For more information, please go', ], 'whois.ttpia.com' => [ # add .com .net .edu ' Welcome to TTpia.com', ' Tomorrow is From Today', ], 'whois.directnic.com' => [ '^By submitting a WHOIS query', '^lawful purposes\. You also agree', '^this data to:', '^email, telephone,', '^or solicitations to', '^customers; or to \(b\) enable', '^that send queries or data to', '^ICANN-Accredited registrar\.', '^The compilation, repackaging,', '^data is expressly prohibited', '^directNIC.com\.', '^directNIC.com reserves the right', '^database in its sole discretion,', '^excessive querying of the database', '^this policy\.', '^directNIC reserves the right to', '^NOTE: THE WHOIS DATABASE IS A', '^LACK OF A DOMAIN RECORD DOES', '^Intercosmos Media Group, Inc', '^Registrar WHOIS database for', '^may only be used to assist in', '^registration record\.', '^directNIC makes this information', '^its accuracy\.', ], 'whois.alldomains.com' => [ '^MarkMonitor.com - ', '^------------------', '^For Global Domain ', '^and Enterprise DNS,', '^------------------', '^The Data in MarkMon', '^for information pur', '^about or related to', '^does not guarantee ', '^that you will use t', '^circumstances will ', '^support the transmi', '^solicitations via e', '^electronic processe', '^MarkMonitor.com res', '^By submitting this ', ], 'whois.gdns.net' => [ '^\\w+ Whois Server', '^Access to .* WHOIS information is provided to', '^determining the contents of a domain name', '^registrar database. The data in', '^informational purposes only, and', '^Compilation, repackaging, dissemination,', '^in its entirety, or a substantial portion', 'prior written permission. By', '^by this policy. All rights reserved.', ], 'whois.worldnames.net' => [ '^----------------------------------', '^.\\w+ Domain .* Whois service', '^Copyright by .* Domain LTD', '^----------------------------------', '^Database last updated', ], 'whois.godaddy.com' => [ '^The data contained in GoDaddy.com,', '^while believed by the company to be', '^with no guarantee or warranties', '^information is provided for the sole', '^in obtaining information about domain', '^Any use of this data for any other', '^permission of GoDaddy.com, Inc.', '^you agree to these terms of usage', '^you agree not to use this data to', '^dissemination or collection of this', '^purpose, such as the transmission of', '^and solicitations of any kind, including', '^not to use this data to enable high volume,', '^processes designed to collect or compile', '^including mining this data for your own', '^Please note: the registrant of the domain', '^in the "registrant" field. In most cases,', '^is not the registrant of domain names listed', ], 'whois.paycenter.com.cn' => [ '^The Data in Paycenter\'s WHOIS database is', '^for information purposes, and to assist', '^information about or related to a domain', '^record\.', '^Paycenter does not guarantee its accuracy.', '^a WHOIS query, you agree that you will use', '^for lawful purposes and that, under no', '^you use this Data to:', '^\(1\) allow, enable, or otherwise support', '^of mass unsolicited, commercial', '^via e-mail \(spam\); or', '^\(2\) enable high volume, automated,', '^apply to Paycenter or its systems.', '^Paycenter reserves the right to modify', '^By submitting this query, you agree to', ], 'whois.dotster.com' => [ '^The information in this whois database is', '^purpose of assisting you in obtaining', '^name registration records. This information', '^and we do not guarantee its accuracy. By', '^query, you agree that you will use this', '^purposes and that, under no circumstances', '^to: \(1\) enable high volume, automated,', '^stress or load this whois database system', '^information; or \(2\) allow,enable, or', '^transmission of mass, unsolicited, commercial', '^solicitations via facsimile, electronic mail,', '^entitites other than your own existing customers.', '^compilation, repackaging, dissemination or other', '^is expressly prohibited without prior written', '^company. We reserve the right to modify these', '^time. By submitting an inquiry, you agree to', '^and limitations of warranty. Please limit', '^minute and one connection.', ], 'whois.nordnet.net' => [ '^Serveur Whois version', '^\*\*\*\*\*\*\*\*\*', '^\* Base de Donnees des domaines COM, NET et ORG', '^\* enregistres par NORDNET. ', '^\* Ces informations sont affichees par le serve', '^\* Whois de NORDNET, le Registrar du ', '^\* Groupe FRANCE-TELECOM ', '^\* Elles ne peuvent etre utilisees sans l accor', '^\* prealable de NORDNET. ', '^\* ', '^\* Database of registration for COM, NET and ', '^\* ORG by NORDNET. ', '^\* This informations is from NORDNET s Whois ', '^\* Server, the Registrar for the ', '^\* Group FRANCE-TELECOM. ', '^\* Use of this data is strictly prohibited with', '^\* out proper authorisation of NORDNET.', '^Deposez votre domaine sur le site http://www.nordnet.net', '^Copyright Nordnet Registrar', ], 'whois.nsiregistry.net' => [ '^Domain names in the \.com and', '^with many different competing', '^for detailed information', '^>>> Last update of whois database', '^NOTICE: The expiration date', "^registrar's sponsorship", '^currently set to expire', '^date of the domain name', '^registrar\. Users may', '^view the registrar', '^TERMS OF USE: You are not', '^database through the use', '^automated except as reasonably', '^modify existing registrations', 'is provided by VeriSign for $', '^information purposes only', '^about or related to a domain', '^guarantee its accuracy', '^by the following terms of', '^for lawful purposes and', '^to: \(1\) allow, enable', '^unsolicited, commercial', '^or facsimile; or \(2\) enable', '^that apply to VeriSign', '^repackaging, dissemination', '^prohibited without the prior', '^use electronic processes that', '^query the Whois database except', '^domain names or modify existing', '^to restrict your access to the', '^operational stability\. VeriSign', '^Whois database for failure to', '^reserves the right to modify', '^The Registry database contains', '^Registrars\.$', '^Whois Server Version', ], 'whois.nic.travel' => [ '^>>>> Whois database was last updated', '^Tralliance, Inc., the Registry Operator', '^for the WHOIS database through', '^is provided to you for', '^persons in determining', '^Tralliance registry database', '^"as is" and does not', '^agree that you will', '^circumstances will', '^support the transmission', '^solicitations via direct mail', '^contravention of any applicable', '^enable high volume, automated', '^\(or its systems\). Compilation', '^WHOIS database in its entirety', '^allowed without Tralliance', '^right to modify or change', '^subsequent notification of any', '^whatsoever, you agree to abide', '^NOTE: FAILURE TO LOCATE A RECORD', '^OF THE AVAILABILITY OF A DOMAIN NAME', ], 'whois.nic.ht' => [ '^TERMS OF USE: You are not authorized', '^database through the use of electronic', '^automated. Whois database is provided', '^community on by of Consortium FDS/RDDH', '^The data is for information purposes only.', '^guarantee its accuracy. By submitting a', '^by the following terms of use:', '^for lawful purposes and that under', '^to: \(1\) allow, enable, or', '^unsolicited, commercial', '^or facsimile; or \(2\) enable', '^that apply to Consortium FDS/RDDH', '^compilation, repackaging', '^expressly prohibited.', '^Domain Information$', ], 'whois.nic.ki' => [ '^TERMS OF USE: You are not', '^database through the', '^automated. Whois database', '^community on behalf of CoCCA', '^The data is for information purposes', '^guarantee its accuracy. By', '^by the following terms of use', '^for lawful purposes and that', '^to: \(1\) allow, enable, or', '^unsolicited, commercial', '^or facsimile; or \(2\) enable', '^that apply to CoCCA it\'s members', '^compilation, repackaging', '^expressly prohibited.', ], 'whois.nic.la' => [ '^This whois service is provided by', '^pertaining to Internet domain names', '^using this service you are agreeing', '^here for any purpose other than', '^to store or reproduce this data', ], 'whois.nic.sb' => [ '^TERMS OF USE: You are not authorized', '^The data is for information purposes only', '^CoCCA Helpdesk \| http://helpdesk.cocca.cx', '^Domain Information$', ], 'whois.nic.tl' => [ '^TERMS OF USE: You are not authorized', '^database through the use of', '^automated. Whois database is', '^community on behalf of CoCCA', '^The data is for information', '^guarantee its accuracy. By', '^by the following terms of use', '^for lawful purposes and that', '^to: \(1\) allow, enable, or', '^unsolicited, commercial', '^or facsimile; or', '^that apply to CoCCA', '^compilation, repackaging', '^expressly prohibited', '^CoCCA Helpdesk', '^Domain Information$', ], 'whois.nic.fm' => [ '^TERMS OF USE', '^dotFM makes every effort', 'is a registered trademark of BRS Media Inc.', '^Domain Information$', ], 'whois.nic.co' => [ '^>>>> Whois database was last', '^.CO Internet, S.A.S., the', '^information for the WHOIS', '^This information is provided', '^designed to assist persons', '^registration record in the', '^information available to you', '^By submitting a WHOIS query', '^lawful purposes and that', '^\(1\) to allow, enable', '^unsolicited, commercial', '^electronic mail, or by', '^data and privacy protection', '^electronic processes that', '^repackaging, dissemination', '^entirety, or of a substantial', '^.CO Internet', '^change these conditions at', '^of any kind. By executing', '^abide by these terms.', '^NOTE: FAILURE TO LOCATE', '^OF THE AVAILABILITY', '^All domain names are subject', '^rules. For details, please', ], 'whois.domain.kg' => [ '^%', ], 'whois.belizenic.bz' => [ '^The data in BelizeNIC registrar WHOIS database is provided to you by', '^BelizeNIC registrar for information purposes only, that is, to assist you in', '^obtaining information about or related to a domain name registration', '^record. BelizeNIC registrar makes this information available "as is,"', '^and', '^does not guarantee its accuracy. By submitting a WHOIS query, you', '^agree that you will use this data only for lawful purposes and that,', '^under no circumstances', '^or otherwise support the transmission of mass unsolicited, commercial', '^advertising or solicitations via direct mail, electronic mail, or by', '^telephone; ', '^that apply to BelizeNIC', '^repackaging, dissemination or other use of this data is expressly', '^prohibited without the prior written consent of BelizeNIC registrar.', '^BelizeNIC registrar reserves the right to modify these terms at any time.', '^By submitting this query, you agree to abide by these terms.', ], 'whois.nic.xxx' => [ '^Access to the .XXX WHOIS information is provided to assist persons in', '^determining the contents of a domain name registration record in the', '^ICM Registry database. The data in this record is provided by', '^ICM Registry for informational purposes only, and ICM does not', '^guarantee its accuracy. This service is intended only for query-based', '^access. You agree that you will use this data only for lawful purposes', '^and that, under no circumstances will you use this data to', '^enable, or otherwise support the transmission by e-mail, telephone, or', '^facsimile of mass unsolicited, commercial advertising or solicitations', '^to entities other than the data recipient', '^\(b\) enable high volume, automated, electronic processes that send', '^queries or data to the systems of Registry Operator, a Registrar, or', '^ICM except as reasonably necessary to register domain names or', '^modify existing registrations. All rights reserved. ICM reserves', '^the right to modify these terms at any time. By submitting this query,', '^you agree to abide by this policy.', ], ); our %exceed = ( 'whois.eu' => '(?:Excessive querying, grace period of|Still in grace period, wait)', 'whois.dns.lu' => 'Excessive querying, grace period of', 'whois.mynic.net.my' => 'Query limitation is', 'whois.ripn.net' => 'exceeded allowed connection rate', 'whois.domain-registry.nl' => 'too many requests', 'whois.nic.uk' => 'and will be replenished', 'whois.networksolutions.com' => 'contained within a list of IP addresses that may have failed', 'whois.worldsite.ws' => 'You exceeded the maximum', 'whois.tucows.com' => '(?:Maximum Daily connection limit reached|exceeded maximum connection limit)', 'whois.centralnic.com' => 'Query rate of \\d+', 'whois.pir.org' => 'WHOIS LIMIT EXCEEDED', 'whois.nic.ms' => 'Look up quota exceeded', 'whois.nic.gs' => 'look up quota exceeded', 'whois.nic.tl' => 'Lookup quota exceeded', 'whois.nic.mg' => 'Lookup quota exceeded', 'whois.nic.li' => 'You have exceeded this limit', 'whois.nic.ch' => 'You have exceeded this limit', ); our $default_ban_time = 60; our %ban_time = ( 'whois.ripn.net' => 60, ); # Whois servers which has no idn support our %whois_servers_with_no_idn_support = ( 'whois.melbourneit.com' => 1, ); # Internal postprocessing subroutines our %postprocess = ( 'whois.pp.ua' => sub { $_[0] =~ s/[\x00\x0A]+$//; $_[0]; }, ); # Special query prefix strings for some servers our %query_prefix = ( 'whois.crsnic.net' => 'domain ', 'whois.denic.de' => '-T dn,ace -C ISO-8859-1 ', 'whois.nic.name' => 'domain=', 'whois.nic.name.ns' => 'nameserver=', 'whois.pir.org.ns' => 'HO ', 'whois.biz.ns' => 'nameserver ', 'whois.nsiregistry.net.ns' => 'nameserver = ', ); 1; Net-Whois-Raw-2.43/t000755000000000000 012014617173 14602 5ustar00unknownunknown000000000000Net-Whois-Raw-2.43/t/01-local.t000444000000000000 375212014615151 16435 0ustar00unknownunknown000000000000#!/usr/bin/perl -w use strict; use Test::More tests => 20; use_ok('Net::Whois::Raw'); use_ok('Net::Whois::Raw::Common'); ok( Net::Whois::Raw::Common::domain_level( 'reg.ru' ) == 2, 'domain_level' ); ok( Net::Whois::Raw::Common::domain_level(' www.reg.ru' ) == 3, 'domain_level' ); my ($name, $tld) = Net::Whois::Raw::Common::split_domain( 'reg.ru' ); ok( $name eq 'reg' && $tld eq 'ru', 'split_domain' ); ($name, $tld) = Net::Whois::Raw::Common::split_domain( 'REG.RU' ); ok( $name eq 'REG' && $tld eq 'RU', 'split_domain'); ($name, $tld) = Net::Whois::Raw::Common::split_domain( 'auto.msk.ru' ); ok( $name eq 'auto' && $tld eq 'msk.ru', 'split_domain' ); ok( Net::Whois::Raw::Common::is_ipaddr( '122.234.214.214' ), 'is_ipaddr' ); ok( !Net::Whois::Raw::Common::is_ipaddr( 'a22.b34.214.214' ), 'is_ipaddr' ); ok( Net::Whois::Raw::Common::get_dom_tld( '125.214.84.1' ) eq 'IP', 'get_dom_tld' ); ok( Net::Whois::Raw::Common::get_dom_tld( 'REGRU-REG-RIPN' ) eq 'NOTLD', 'get_dom_tld' ); ok( Net::Whois::Raw::Common::get_dom_tld( 'yandex.ru' ) eq 'ru', 'get_dom_tld' ); ok( Net::Whois::Raw::Common::get_dom_tld( 'auto.msk.ru' ) eq 'msk.ru', 'get_dom_tld' ); ok( Net::Whois::Raw::Common::get_real_whois_query( 'sourceforge.net', 'whois.crsnic.net' ) eq 'domain sourceforge.net', 'get_real_whois_query' ); ok( Net::Whois::Raw::Common::get_real_whois_query( 'mobile.de', 'whois.denic.de' ) eq '-T dn,ace -C ISO-8859-1 mobile.de', 'get_real_whois_query' ); ok( Net::Whois::Raw::Common::get_real_whois_query( 'nic.name', 'whois.nic.name' ) eq 'domain=nic.name', 'get_real_whois_query' ); ok( Net::Whois::Raw::Common::get_real_whois_query( 'reg.ru', 'whois.ripn.net' ) eq 'reg.ru', 'get_real_whois_query' ); is( Net::Whois::Raw::Common::get_server( 'reg.ru' ), 'whois.ripn.net', 'get_server' ); is( Net::Whois::Raw::Common::get_server( 'nic.vn' ), 'www_whois', 'get_server' ); is( Net::Whois::Raw::Common::get_server( undef, undef, 'spb.ru' ), 'whois.nic.ru', 'get_server' ); Net-Whois-Raw-2.43/t/02-internet.t000444000000000000 461112014615151 17167 0ustar00unknownunknown000000000000#!/usr/bin/perl -w use strict; use Data::Dumper; use Test::More tests => 10; BEGIN { use_ok('Net::Whois::Raw',qw( whois )); $Net::Whois::Raw::CHECK_FAIL = 1; $Net::Whois::Raw::OMIT_MSG = 1; $Net::Whois::Raw::CHECK_EXCEED = 1; }; my @domains = qw( yahoo.com freebsd.org reg.ru ns1.nameself.com.NS XN--C1AD6A.XN--P1AI ); SKIP: { print "The following tests requires internet connection. Checking...\n"; skip "Looks like no internet connection", Test::More->builder->expected_tests() - 1 unless get_connected(); # registrars like( whois( 'REGRU-REG-RIPN', 'whois.ripn.net' ), qr/www.reg.ru/ ); # domains foreach my $domain ( @domains ) { my $txt = whois( $domain ); $domain =~ s/.NS$//i; ok($txt && $txt =~ /$domain/i, "$domain resolved"); } # Net::Whois::Raw::www_whois_query for AC domain # ok( Net::Whois::Raw::www_whois_query( 'nic.ac' ) =~ /Organization Name.*Network Information Center/i, "www_whois_query"); # Net::Whois::Raw::Common::process_whois no warnings; $Net::Whois::Raw::CHECK_FAIL = 0; $Net::Whois::Raw::OMIT_MSG = 0; $Net::Whois::Raw::CHECK_EXCEED = 0; my $whois = whois('reg.ru'); my ($processed) = Net::Whois::Raw::Common::process_whois( 'reg.ru', 'whois.ripn.net', $whois, 2, 2, 2 ); ok( length( $processed ) < length( $whois ) && $processed =~ /reg\.ru/, 'process_whois' ); # Net::Whois::Raw::Common::write_to_cache my $test_domain = 'google.com'; my $tmp_dir; if ($^O =~ /mswin/i) { $tmp_dir = $ENV{TEMP}.'\net-whois-raw-common-test-'.time; } else { $tmp_dir = '/tmp/net-whois-raw-common-test-'.time; } my $cache_file = "$tmp_dir/$test_domain.00"; $Net::Whois::Raw::CACHE_DIR = $tmp_dir; $whois = whois( $test_domain, undef, 'QRY_FIRST' ); ok( -e $cache_file, 'write_to_cache' ); # Net::Whois::Raw::Common::get_from_cache open CACHE, ">>$cache_file"; print CACHE "net-whois-raw-common-test"; close CACHE; like( whois( $test_domain, undef, 'QRY_FIRST' ), qr/net-whois-raw-common-test/s, 'get_from_cache' ); unlink <$tmp_dir/*>; rmdir $tmp_dir; }; sub get_connected { require LWP::UserAgent; my $ua = LWP::UserAgent->new( timeout => 10 ); my $res = $ua->get( 'http://www.google.com' ); return $res->is_success; } Net-Whois-Raw-2.43/t/03-coverage.t000444000000000000 432312014615151 17133 0ustar00unknownunknown000000000000#!/usr/bin/perl -w use strict; use LWP::UserAgent; use Test::More; use Net::Whois::Raw; { no warnings; $Net::Whois::Raw::CHECK_FAIL = 2; $Net::Whois::Raw::OMIT_MSG = 2; $Net::Whois::Raw::CHECK_EXCEED = 2; $Net::Whois::Raw::TIMEOUT = 10; } our $DEBUG = 0; our $fake_domain = "fake123domain"; our %psevdo_zone = map {$_ => 1} qw/ARPA NS RIPE IP/; my $tests_number = keys(%Net::Whois::Raw::Data::servers) * 2; if ($ARGV[0] && $ARGV[0] eq "-f") { plan tests => $tests_number; } else { plan skip_all => "Coverage tests skiped by default."; } print "The following tests requires internet connection.\n"; print "Coverage tests skiped by default. Run with -f to force.\n"; foreach my $tld (sort keys %Net::Whois::Raw::Data::servers) { SKIP: { skip( "Psevdozona $tld", 2 ) if $psevdo_zone{$tld}; my $server = $Net::Whois::Raw::Data::servers{$tld}; my $domain = get_domain($tld); skip( "Cant find domain in .$tld", 2 ) unless $domain; my $whois = eval { whois( $domain ) }; print "---------------\n$whois\n-------------\n" if $DEBUG; if ($@) { ok( 0, "TLD: $tld,\tdomain: $domain,\tserver: $server\t - timeout"); } else { ok( $whois, "TLD: $tld,\tdomain: $domain,\tserver: $server"); } $domain = "$fake_domain.$tld"; $whois = eval { whois( $domain ) }; if ($@) { ok( 0, "TLD: $tld,\tdomain: $domain,\tserver: $server\t - timeout"); } else { ok( !$whois, "TLD: $tld,\tdomain: $domain,\tserver: $server"); } print "\n"; } }; sub get_domain { my $tld = shift; my $content = get_google($tld); my ($domain) = $content =~ /new( GET => 'http://www.google.com.ua/search?q=site:'.$tld ); my $res = $ua->request($req); return $res->content; } Net-Whois-Raw-2.43/t/04-coro-domains.pl000444000000000000 355612014615151 20112 0ustar00unknownunknown000000000000#!/usr/bin/perl -w use strict; use Test::More tests => 6; BEGIN { use Socket; eval " use Coro; use Coro::AnyEvent; use Coro::Socket; use Coro::LWP; "; $::require_coro = $@ if $@; use_ok('Net::Whois::Raw',qw( whois )); $Net::Whois::Raw::CHECK_FAIL = 1; $Net::Whois::Raw::OMIT_MSG = 1; $Net::Whois::Raw::CHECK_EXCEED = 1; }; my @domains = qw( yahoo.com freebsd.org reg.ru ns1.nameself.com.NS belizenic.bz ); my $dns_cache = {}; SKIP: { print "The following tests requires internet connection. Checking...\n"; skip "Looks like no internet connection", 5 unless get_connected(); print "The following tests requires Coro. Checking...\n"; skip "Looks like no Coro installed", 5 unless require_coro (); my @coros = (); # domains foreach my $domain ( @domains ) { push @coros, Coro->new (sub { my $txt = whois( $domain ); $domain =~ s/.NS$//i; ok($txt && $txt =~ /$domain/i, "domain '$domain' resolved"); }); } $_->ready foreach @coros; $_->join foreach @coros; }; sub get_connected { require LWP::UserAgent; my $ua = LWP::UserAgent->new( timeout => 10 ); my $res = $ua->get( 'http://www.google.com' ); return $res->is_success; } sub require_coro { no warnings 'once'; *Net::Whois::Raw::whois_socket_fixup = sub { my $class = shift; my $sock = shift; return Coro::Socket->new_from_fh ($sock, partial => 1); }; *Net::Whois::Raw::whois_query_sockparams = sub { my $class = shift; my $domain = shift; my $name = shift; if (! $dns_cache->{$name}) { my $ip = inet_ntoa (inet_aton ($name)); $dns_cache->{$name} = $ip; } return ( PeerAddr => $dns_cache->{$name}, PeerPort => 43, # LocalHost => , # LocalPort => ); }; return ! $::require_coro; } Net-Whois-Raw-2.43/t/example-domains-load-balancing.pl000444000000000000 764712014615151 23220 0ustar00unknownunknown000000000000#!/usr/bin/perl -w use strict; use Test::More (tests => 6, skip_all => 'tmp'); exit; sub ip_to_dword { my $ip = shift; # assume ipv4 return unpack('B32', pack('C4C4C4C4', split(/\./, $ip))); } sub dword_to_ip { my $dword = shift; return join '.', unpack('C4C4C4C4', pack('B32', $dword)); } BEGIN { use Socket; eval " use Coro; use Coro::AnyEvent; use Coro::Socket; use Coro::LWP; use Coro::Timer; use DBI:SQLite; "; $::require_coro = $@ if $@; unlink "db.sqlite"; $ENV{DBI_DSN} ||= 'DBI:SQLite:dbname=db.sqlite'; $ENV{DBI_USER} ||= ''; $ENV{DBI_PASS} ||= ''; use DBI; $::dbh = DBI->connect; $::dbh->do ('create table whois_quota ( name varchar(200), ip varchar(15), ip_expire integer, quota integer );'); $::dbh->do ('create table whois_connection ( local_ip integer, remote_ip integer, created integer, domain varchar(300) );'); $::dbh->do ('create table whois_ip ( local_ip varchar(15) );'); # TODO: FILL IP LIST into whois_ip $::dbh->do ('insert into whois_ip values (?);', {}, ip_to_dword ('192.168.2.2')); $::dbh->do ('insert into whois_ip values (?);', {}, ip_to_dword ('10.0.2.6')); use_ok('Net::Whois::Raw',qw( whois )); $Net::Whois::Raw::CHECK_FAIL = 1; $Net::Whois::Raw::OMIT_MSG = 1; $Net::Whois::Raw::CHECK_EXCEED = 1; }; my @domains = qw( yahoo.com freebsd.org reg.ru ns1.nameself.com.NS belizenic.bz ); my $dns_cache = {}; SKIP: { print "The following tests requires internet connection. Checking...\n"; skip "Looks like no internet connection", 5 unless get_connected(); print "The following tests requires Coro. Checking...\n"; skip "Looks like no Coro installed", 5 unless require_coro (); my @coros = (); # domains foreach my $domain ( @domains ) { push @coros, Coro->new (sub { my $txt = whois( $domain ); $::dbh->do ('delete from whois_connection where domain = ?', {}, $domain); $domain =~ s/.NS$//i; ok($txt && $txt =~ /$domain/i, "domain '$domain' resolved"); }); } $_->ready foreach @coros; $_->join foreach @coros; }; sub get_connected { require LWP::UserAgent; my $ua = LWP::UserAgent->new( timeout => 10 ); my $res = $ua->get( 'http://www.google.com' ); return $res->is_success; } sub require_coro { no warnings 'once'; *Net::Whois::Raw::whois_socket_fixup = sub { my $class = shift; my $sock = shift; return Coro::Socket->new_from_fh ($sock, partial => 1); }; *Net::Whois::Raw::whois_query_sockparams = sub { my $class = shift; my $domain = shift; my $name = shift; # TODO: YOU MUST PLACE QUOTA CHECK HERE # my $sth = $::dbh->prepare ('select * from '); my $ip; if (! $dns_cache->{$name}) { $ip = inet_ntoa (inet_aton ($name)); # TODO: use coro::util for resolve $dns_cache->{$name} = $ip; } else { $ip = $dns_cache->{$name}; } my $ip_num = ip_to_dword ($ip); my $sth = $::dbh->prepare ( 'select local_ip from whois_ip where local_ip not in (select local_ip from whois_connection where remote_ip = ? group by local_ip) limit 1;' ); my $rows_affected = $sth->execute ($ip_num); my $result = $sth->fetchall_arrayref ({}); $sth->finish; if (@$result == 0) { # no free ips, try to use minimally loaded $sth = $::dbh->prepare ('select local_ip, count(local_ip) as local_ip_c from whois_connection where remote_ip = ? and created > ? group by local_ip order by count(local_ip) asc limit 1;'); $rows_affected = $sth->execute ($ip_num); $result = $sth->fetchall_arrayref ({}); } $::dbh->do ( 'insert into whois_connection values (?, ?, ?, ?);', {}, $result->[0]->{local_ip}, $ip_num, time, $domain ); return ( PeerAddr => $dns_cache->{$name}, PeerPort => 43, LocalHost => dword_to_ip ($result->[0]->{local_ip}), # LocalPort => ); }; return ! $::require_coro; }