<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
     "dtd/xml/4.1.2/docbookx.dtd"[
<!ENTITY % afnic_custom SYSTEM "../../lib/afnic-docbook.inc">
%afnic_custom;
]>
<!-- $Id: whois.db,v 1.6 2004-11-25 16:10:39 bortzmeyer Exp $ -->
<article>
  <articleinfo>
    <title>The whois service</title>
    <author>
      <surname>Bortzmeyer</surname>
      <firstname>Stephane</firstname>
    </author>
    <pubdate>$Date: 2004-11-25 16:10:39 $</pubdate>
  </articleinfo>
    <important><para>whois is often used, not only to describe a very specific
service running on TCP port 43, but to describe any kind of interface
to get social information about a domain holder or contacts.</para> <para>We will talk about
whois only in its specific meaning here, avoiding the term whois when
discussing a Web interface, for instance.</para>
    </important>
<section><title>Why a whois service?</title>
<para>The registry holds a lot of social information about the domain
names holders and about the contacts: names,
postal and email addresses, phone numbers, etc. This information can
be distributed to the outside.</para>
<para>The social information has a <ulink url="http://www.centr.org/docs/statements/CENTR-Position-on-Whois.html">lot of operational uses</ulink>: to find
the contacts when you have a problem with a domain, for
instance. Engineers use it when there is a network problem, anti-spam
software use it to gather (not always carefully) email addresses to
complain to, etc.</para>
<para>whois or whois-like services  are also used by Intellectual
Property lawyers, for instance to ask a cybersquatter to desist, or to harass domain names holders, pretending there is a
trademark infringment.</para>
  </section>
<section><title>What is whois?</title>
<para>whois, as a protocol, is specified in <rfc num="3912"/>. The
standard does not specify any policy.</para>
<para>The protocol itself is quite simple and anyone can write a whois
client or server in one hour (see the RFC for details). But an useful whois server must do more:
it musts connects to the datastore of the registry, in order to
retrieve the social information. So, the information served by whois
is a subset of the information stored in the
database<footnote><para>You will often meet phrases like <quote>whois
database</quote>. They come from the old days where this model was not
understood as it is now. In these times, it was common for a registry
to have several - and not always synchronized - databases, including
one only for the whois service. Some whois servers still work that
way.</para>
      </footnote>. Here is a possible model, for a whois
server whose data store is a relational DBMS:
<figure float="1">
	<title>Model of a whois server</title>
      <mediaobject>
         <imageobject>
           <imagedata fileref="whois.eps" format="EPS"/>
         </imageobject>
         <imageobject>
           <imagedata fileref="whois.png" format="PNG"/>
         </imageobject>
         <textobject>
           <phrase>The whois client queries the whois server which in
           turn queries the database.</phrase>
         </textobject>
         <caption>
           <para>This shows that a whois server is only a relay
           between the client and the data store.
           </para>
         </caption>
       </mediaobject>
      </figure>
</para>
<para>whois works by accepting a request, expressed as a string<footnote><para>That string may
include several words, some whois servers accept options.</para>
      </footnote>, which typically identifies a
domain name (such as <systemitem>example.com</systemitem>) or a person
or entity (such as <systemitem>SB164-FRNIC</systemitem> which is a
<emphasis>handle</emphasis>, an unique identifier automatically
assigned to a person or a group).</para>
<para>In exchange, whois sends back a set of information, very often
structured as a list of attribute-values pairs. For instance, "name:
Bortzmeyer", "phone: 123 456 789", etc.</para>
<para>The actual output of the whois server depends on the server
used: there is no standard of presentation and it is one of the big
problems with <rfc num="3912"/>. Here is the output of whois.nic.fr for
a role (a group of persons) of handle
<systemitem>HN16-FRNIC</systemitem> :
<programlisting>
role:        Hostmaster Netaktiv
address:     Netaktiv
address:     223, rue de Charenton
address:     75012 Paris
address:     France
phone:       +33 1 40 02 92 22
fax-no:      +33 1 40 02 01 02
e-mail:      hostmaster@netaktiv.com
nic-hdl:     HN16-FRNIC
</programlisting>
and here is the output of whois.nic.de for the domain
<systemitem>tageszeitung.de</systemitem>:
<programlisting>
domain:      tageszeitung.de
descr:       Koelmel Computer GmbH
descr:       Gutenbergstrasse 1-3
descr:       D-76437 Rastatt
descr:       Germany
nserver:     s15123983.rootmaster.info
nserver:     ns.schlund.de
</programlisting>
and here the output of whois.dns.be for the domain
<systemitem>ecolo.be</systemitem>:
<programlisting>
Domain:      ecolo
Status:      Registered
Registered:  Fri Jan 12 1996

Licensee:
   Name:     Philippe LESNE
   Company:  ECOLO-CEFE 
   Language: F 
   Address:  Rue du Seminaire 8
             5000 Namur
             Belgium
   Phone:    +32 81 22.78.71
   Fax:      +32 81 23.06.03
   Email:    hostmaster@ecolo.be
</programlisting>
</para>
<para>Each registry maintains its own whois server. There is no easy
way to find out the name of the whois server for a given TLD, although
<systemitem>whois.nic.<replaceable>TLD</replaceable></systemitem> is
common. The <ulink
url="http://mailbox.univie.ac.at/~gw/draft-sanz-whois-srv-00.txt">The
Internet-Draft "Using DNS SRV records to locate whois servers"</ulink>
suggests way which is deployed in many European ccTLDs. It is
implemented, for instance, in our <ulink
url="http://www.generic-nic.net/dyn/whois/">whois client service</ulink>.</para>
<para><systemitem>.com</systemitem> and <systemitem>.net</systemitem>
use a different system: the registry is a <emphasis>thin</emphasis>
registry meaning that the registry does not hold the social
information. Instead, the registrars hold it. Each must have its own
whois server. In its reply, the whois server of the registry sends the
name of the whois server of the registrar, the client is responsible
for following it.</para> 
  </section>
<section><title>Policy issues with whois</title>
<para>Designing a whois service requires the handling of touchy policy
issues. Most are not specific to whois: any registry information
service would have the same problem.</para>
<itemizedlist>
	<listitem><para>Privacy of users: what should we
	publish?</para>
	<para>See for instance <ulink
	url="http://www.katalog.uninett.no/needs/deliverables/Privacy_Aspects_of_the_NEEDS_project.pdf">Privacy
	Aspects of the NEEDS project</ulink>, the legal framework in
	Europe, <ulink
	url="http://europa.eu.int/eur-lex/en/com/pdf/2000/en_500PC0385.pdf">DIRECTIVE
	OF THE EUROPEAN PARLIAMENT AND of the council concerning the processing of personal data and the protection of privacy in the
                     electronic communications sector</ulink>, <ulink
	url="http://www.dnso.org/clubpublic/nc-whois/Arc00/bin00022.bin"><systemitem>.name</systemitem>
	Whois Proposal</ulink> or <ulink
	url="http://www.icann.org/montreal/whois-topic.htm">ICANN ideas</ulink>.</para>
	</listitem>
	<listitem><para>Correctness of the data: how to ensure it?</para>
	</listitem>
      <listitem><para>Legal local rules: what are their consequences?</para>
      </listitem>
      </itemizedlist>
  </section>
  <section>
    <title>whois software</title>
<section><title>Clients</title>
<para>Many whois clients exist. Since the protocol is so dumb, the
client very often tries to be smart and to guess the proper whois
server, by a combination of heuristics, hardwired tables, DNS SRV
records, etc.</para>
<para>Here is a session with the whois client of the Debian operating
system:
<programlisting>
<prompt>% </prompt><command>whois <replaceable>nic.fr</replaceable></command>

Tous droits reserves par copyright.
Voir http://www.nic.fr/outils/dbcopyright.html
Rights restricted by copyright.
See http://www.nic.fr/outils/dbcopyright.html

domain:      nic.fr
descr:       AFNIC
descr:       Immeuble International
descr:       2, rue Stephenson
</programlisting>
And here with a domain in <systemitem>.com</systemitem> (the client
follows the referral):
<programlisting>
<prompt>% </prompt><command>whois <replaceable>nic.com</replaceable></command>

Found a referral to whois.networksolutions.com.
...
Registrant:
NIC (NIC3-DOM)
   637 Wyckoff Ave #294
   Wyckoff, NJ 07430
   US

   Domain Name: NIC.COM

   Administrative Contact, Technical Contact:
      Semonche, Douglas C  (DS69)               dcs@NIC.COM
      637 WYCKOFF AVE # 294
      WYCKOFF, NJ 07481-1438
      US
      (201) 934-1445 fax: 123 123 1234
</programlisting>
You can also force the client to go to a specific server:
<programlisting>
<prompt>% </prompt><command>whois -h <replaceable>whois.gandi.net</replaceable> <replaceable>ffti.org</replaceable></command>
% GANDI Registrar whois database for .COM, .NET, .ORG.
...

domain:         ffti.org
owner-address:  AFNIC NIC-FR
owner-address:  Immeuble International - 2,rue Stephenson - Montigny le Bretonneux
owner-address:  78181
owner-address:  Saint-Quentin-en-Yvelines
owner-address:  France
admin-c:        ANF2-GANDI
</programlisting>
</para>
<para>Here is an incomplete list of whois clients:
  <itemizedlist>
	  <listitem><para><ulink
	  url="http://packages.debian.org/stable/net/whois.html">Debian
	  whois</ulink> (GNU whois)</para>
	  </listitem>
	  <listitem><para><ulink url="ftp://ftp.ripe.net/tools">RIPE whois</ulink></para>
	  </listitem>
	<listitem><para><ulink
	url="http://open.gandi.net/">WhoisExtract</ulink> is not a
	command-line client but a library to parse the various formats
	of whois servers.</para>
	  </listitem>
	  <listitem><para>Net::Xwhois, in the CPAN, a Perl library to
	  parse the various formats
	of whois servers.</para>
	  </listitem>
	</itemizedlist></para>
</section>
<section><title>whois servers</title>
<para>It is very difficult to write a generic whois server since you
depend a lot on the local policy and of the schema of the data
store. The first two given here have a specific database. The last
one, GenericWhois,
has a separate backend that is not generic and must be written for
each registry:
  <itemizedlist>
	  <listitem><para><ulink url="ftp://ftp.ripe.net/tools">RIPE
	  whois</ulink></para>
	  </listitem>
	  <listitem><para><ulink url="http://dan.drydog.com/swhoisd/">swhoisd</ulink></para>
	  </listitem>
	  <listitem><para><ulink
	  url="GenericWhois-0.0-BETA.tar.gz">GenericWhois</ulink>, a generic
	  whois server. It separates the
front-end, which deals with the whois protocol, network issues, rate
limiting, blacklisting, etc, and the back end which is highly
registry-specific and deals with the business rules, the interface with
the actual data store, etc.</para>
	  </listitem>
	</itemizedlist></para>
    </section>
  </section>
<section>
    <title>The future</title>
<para>whois is a very old and obsolete protocol. However, no
replacement is coming soon. Many attempts have been done: rwhois (<rfc
num="2167"/>, still used by ARIN and promoted by <ulink
url="http://www.rwhois.net/">the RWhois project</ulink>, which
distributes a free software), whois++ (<rfc num="1835"/>), LDAP
(<rfc num="2798"/>), etc. Most of them were failures (not always
technical failures).</para>
<para>An IETF Working Group, CRISP (<ulink
url="http://www.ietf.org/html.charters/crisp-charter.html">Cross
Registry Information Service Protocol</ulink>, works on a new and
improved protocol. The current proposal, IRIS, is based on XML.</para>
  </section>
</article>
