Author image Abraham Ingersoll


Net::ParseWhois - An extendable alternative to Net::Whois for parsing whois information.


  # below code based on t/ in Net::ParseWhois distribution package ...

  use Net::ParseWhois;

  my $dom = '';

  my $w = Net::ParseWhois::Domain->new($dom);
  unless ($w->ok) {
        warn "error: " . $w->{'error'} . "\n" if $w->{'error'};
        die "No match for $dom\n";

  print "Registrar: ", $w->registrar, "\n";
  print "Domain: ", $w->domain, "\n";
  print "Name: ", $w->name, "\n";
  print "Tag: ", $w->tag, "\n";
  print "Address:\n", map { "    $_\n" } $w->address;
  print "Country: ", $w->country, "\n";
  print "Name Servers:\n", map { "    $$_[0] ($$_[1])\n" }  @{$w->servers};
  my ($c, $t);
  if ($c = $w->contacts) {
    print "Contacts:\n";
    for $t (sort keys %$c) {
      print "    $t:\n";
      print map { "\t$_\n" } @{$$c{$t}};
  print "Record created:", $w->record_created ;
  print "\nRecord updated:", $w->record_updated,"\n";


Net::ParseWhois currently only supports domains from major TLDs and Registrars (.com, .net & .org -- see REGISTRARS for an exact list of who's supported) and tries to maintain backward interface compatability with Net::Whois.

Net::ParseWhois is my attempt at updating Net::Whois to support whois referrals. The author of Net::Whois (Dana Hudes) and I disgreed on how to solve the problem of parsing a distrubuted and non-standardized whois system, so I created this divergent module. (It's my understanding that Mr. Hudes wants to create an IETF draft and assumes registrars/registries will then follow it. I've simply taken the current not-so-defined situation and coded around it.)

Net::ParseWhois contains a generalized parsing system that can be configured for each Registrar, or completely overridden as needed.

The class Net::ParseWhois::Domain::Registrar contains a list of known servers that could be returned in a whois referral, and specifies the specific class to use for each. When Net::ParseWhois receives a referral from the 'root' whois server, it creates the specified object and calls follow_referral on that object. If a domain is found and a referral given, but no Registrar class has been defined to handle that referral, the method ok will return true but method 'unknown_registrar' will also return true. Net::ParseWhois will still follow the referral, and the raw output from the registrar will be available via the method 'raw_whois_text'.


Currently supported: - Dotster, Inc. -, Inc. - Network Solutions, Inc. -, Inc. - Tierranet, Inc. -, Inc. - Domain Bank, Inc. - INTERNET DOMAIN REGISTRARS (Shopnow?) - Core Internet Council of Registrars -  Melbourne IT, aka Internet Names Worldwide - Easyspace, Ltd.

Not supported (with notes..): - should be easy. - easy - easy - easy - easy - easy, but no nameserver or expire/updated data - not too hard. follows same structure, but uses different template/style - different style, not too hard - Korean based registrar, field's are labeled. would require work. - French, RIPE style whois. - might be ugly. no newlines between different sections - no data?? down?

        Known registrars that I haven't looked at --

Note: Now that CoreNic is supported (thanks Vern!), Net::ParseWhois's supported registrars should cover upwards of 90% of the GTLD registrations that are out there.

COMMON METHODS (Specific to Net::ParseWhois)





The Net::ParseWhois project homepage:

The Net::ParseWhois mailing list:

    netparsewhois at lists dot dajoba dot com

Net::Whois, Net::Whois::Raw, Net::RWhois


Net::ParseWhois is maintained by Abraham A. Ingersoll <>.

This module is a based on Net::Whois, which is maintained by Dana Hudes ( Net::Whois was originally written by Chip Salzenberg (

Thanks to:

Joseph Ingersoll for testing under ActivePerl. Curtis Poe for comments and bug testing. Andy Baio for first version of Simon Flack for newer parsing module & bug sleuthing. Douglas Freake for (yet to be used) address parsing contribution. Vern Hart for (especially tough) parsing module. Adam Stubbs for and parsing modules.


Copyright 2000 Abraham A Ingersoll <>

Some portions may be copyright 1998 Dana Hudes & Chip Salzenberg.

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