README.rdoc

Whois

It is a OS-independent library and doesn't require external C libraries
or Gems: it is a 100% Ruby software with all the advantages and
disadvantages that it involves.

This software was developed to power RoboDomain and, since July 2009, it
ran more than thousands requests.

An extensive test suite is available to verify the library correctness but
you must be aware that registrant might change Whois interfaces without
notice and at any time causing queries to specific hosts to stop working.

Features

Pure Ruby library without any external dependency other than Ruby itself

Intelligent Ruby client

Flexible and extensible configuration with support for user-defined servers

Requirements

Do you run any other Ruby platform or version? Are you experiencing any
problem? Join our discussion group.

Installation

This library is intended to be installed as a Gem.

$ gem install whois

You might need administrator privileges on your system to install it.

Getting Started

Note. This section covers only the essentials for getting started with the
Whois library. The documentation
provides a more accurate explanation including tutorials, more examples and
technical details about the client/server/answer/parser architecture.

Querying the Server

Whois provides the ability to get WHOIS information for hostnames, IPv4 and
IPv6 addresses. The client is smart enough to guess the best WHOIS server
according to given query, send the request and return the response.

This feature is made possible by the Whois answer parsers.
Unfortunately, due to the lack of a global standard, each WHOIS server
requires a specific parser. For this reason, the library doesn't
support all existing WHOIS servers.

If you create a new parser, please consider releasing it to the public so
that it can be included in a next version.

Timeout

By default, each query run though the client has a timeout value of 5
seconds. If the execution exceeds timeout limit, the client raises a
Timeout::Error exception.

Off course, you can customize the timeout value setting a different value.
If timeout is nil, the client will until the response is sent back
from the server or the process is killed. Don't disable the timeout
unless you really know you are doing!

Acknowledgments

First of all, I would like to express my most sincere thanks to Cyril
Mougel, the author of the first Ruby Whois GEM that has been available
since 2007. Cyril has been kind enough to yield me the privilege of using
the RubyForge Whois project and the Whois package name to publish this
library. To express all my gratitude, the release 0.5.0 and all sub
sequential versions of the new Whois up to 0.9.x are 100% compatible with
Cyril's Whois.

Whois is largely inspired by other notable Whois projects, most of all the
Debian Whois library written and maintained by Marco D'Itri. Other good
ideas and design decisions come from the PERL Net::DRI package.

I would lie if I say I'm completely unaware of the other Ruby Whois
projects. Before starting this Ruby Whois library I deeply investigated the
available resources and, despite none of them was a good candidate for a
refactoring, some of them expose a really cool API. They didn't
directly influence this library or any design decision, but they have been
a really interesting code-reading.

The parser architecture has been inspired by the PHPWhois project. The authors
puts lot of effort to create whois-specific parsers normalizing the
different responses in a single tree-based structure. So far, this is the
only one opensource project that offers such this feature in all the
programming language ecosystem.

Despite I spent weeks reading source code from the available whois
libraries, Ruby Whois has been built from scratch trying to focus on
long-term maintainability and flexibility and cannot be considered a Ruby
port of any of other existing Whois libraries.

Note for Whois 0.4 users

As of release 0.5.0, the Whois GEM has been completely rewritten. As I
explained in the Acknowledgment section, Cyril Mougel (the author of the
original Whois package) yield me the privilege to use the Whois RubyForge
project for my new Whois client.

All versions between Whois 0.5.0 and 0.9.x include a compatibility adapter
and the corresponding deprecation warnings to help you migrate to the new
API. Starting from Whois 1.0.0, the library is no longer backward
compatible with Cyril's Whois.