POE::Component::Client::Whois - A one shot non-blocking RFC 812 WHOIS query.


version 1.36


   use strict;
   use warnings;
   use POE qw(Component::Client::Whois);
   use Data::Dumper;

        package_states => [
                'main' => [ qw(_start _response) ],

   exit 0;

   sub _start {
     my ($kernel,$heap) = @_[KERNEL,HEAP];

     POE::Component::Client::Whois->whois( host => "",
                                           query => '',
                                           event => '_response',
                                           _arbitary => [ qw(moo moo moo) ] );

   sub _response {
      print STDERR Dumper( $_[ARG0] );


POE::Component::Client::Whois provides a lightweight one shot non-blocking RFC 812 WHOIS query to other POE sessions and components. The component will attempt to guess the appropriate whois server to connect to based on the query string passed.

If no guess can be made it will connect to for domains, for IPv4 addresses and for IPv6 addresses.



Creates a POE::Component::Client::Whois session. Takes two mandatory arguments and a number of optional:

  'query', the string query to send to the whois server; # Mandatory
  'event', the event name to emit on success/failure; # Mandatory
  'port', the port on the whois server to connect to, defaults to 43;
  'session', a session or alias to send the above 'event' to, defaults to calling session;
  'host', the whois server to query; # Automagically determined by the component
  'referral', indicates to the poco whether to follow ReferralServer; # Default is 1
  'referral_only', indicates whether the poco should only return the results of querying
                   the referral server; # default is 0

One can also pass arbitary data to whois() which will be passed back in the response event. It is advised that one uses an underscore prefix to avoid clashes with future versions.


ARG0 will be a hashref, which contains the original parameters passed to whois() ( including any arbitary data ), plus either one of the following two keys:

  'reply', an arrayref of response lines from the whois server, assuming no error occurred;
  'error', in lieu of a valid response, this will be defined with a brief description of
           what went wrong;

No parsing is undertaken on the returned data, this is an exercise left to the reader >;]


ketas, for first suggesting this module; buu, decay and hazard from #perl @ freenode, for helpful suggestions;

This module is based on the linux whois client from


RFC 812


Chris Williams <>


This software is copyright (c) 2015 by Chris Williams.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.