README for swhoisd
==================
$Id: README,v 1.4 2001/07/04 06:17:04 dan Exp $

See file INSTALL for install instruction.
See file COPYING for license.
See file INTERNATIONALIZATION for message file usage for other languages.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

INTRODUCTION

swhoisd is a daemon that performs a simple query to a text
file with a given pre-defined format and replies to 
whois TCP queries on port 43. 

The current version supports three types of record:
Host, Domain and Person.

The configuration file /etc/swhoisd.conf should be a text
document with the information that is to be provided.

For each host, domain or person, an appropriate record
should be set in swhoisd.conf.

The swhoisd.conf format is as follows:

	# Host Record
	<handle> hr {
		name	<name>
		fqdn	<fqdn>
		os	<os>
		ip	<ip>
		arch	<arch>
		cname	<cname>
		mx	<mx>
		country	<country>
		admin	<handle>
		tech	<handle>
		created	<date>
		updated	<date>
	}

	# Domain Record
	<handle> dr {
		name	<name>
		domain	<domain>
		ns1	<ns1>
		ns1ip	<ns1ip>
		ns2	<ns2>
		ns2ip	<ns2ip>
		ns3	<ns2>
		ns3ip	<ns2ip>
		ns4	<ns2>
		ns4ip	<ns2ip>
		ns5	<ns2>
		ns5ip	<ns2ip>
		ns6	<ns2>
		ns6ip	<ns2ip>
		ns7	<ns2>
		ns7ip	<ns2ip>
		ns8	<ns2>
		ns8ip	<ns2ip>
		ns9	<ns2>
		ns9ip	<ns2ip>
		country	<country>
		contact	<handle>
		admin	<handle>
		tech	<handle>
		created	<date>
		updated	<date>
	}

	# Person Record
	<handle> pr {
		name	<name>
		org	<organization>
		email	<email>
		address	<address>
		country	<country>
		phone	<phone>
		fax	<fax>
		created	<date>
		updated	<date>
	}

	
<handle> is a unique string that identifies the record. 
The second keywork at the start of each record may be
hr, dr or pr, meaning host record, domain record or 
person record.

Each record may have one, few or all of the available 
fields.

The exclamation sign ! before each keyword indicates that
searches are to be done by that field.

	# Example of an host record:

	HOST1 hr {
		!fqdn	host.somewhere.com
		!cname	www.somewhere.com
		mx	10 mail.somehwere.com
		os	SunOS
		arch	sparc
		ip	10.0.0.1
		country	United Kingdom
		tech	PERSON1
	}

	# Example of a domain record:

	DOMAIN1 dr {
		!domain	somewhere.com
		ns1	ns1.somewhere.com
		ns1ip	10.0.0.11
		ns2	ns2.somewhere.com
		ns2ip	10.0.0.12	
		country	United Kingdom
		tech	PERSON1
	}

	# Example of a person record:

	PERSON1 pr {
		!name	My Full Name
		!email		me@somewhere.com
		address		5, Whois Street,
		address		London, X10 Y20
		country		United Kingdom
		phone		+44-111111111
		fax		+44-222222222
	}

In the above examples, host searches are to be done by
fqdn and cname, domain searches by domain and person
searches by name and email fields.

Thus:

	whois host.somewhere.com

will return the appropriate HOST1 record.

	whois somewhere.com 

will return all three records since
it matches the hostname of HOST1, the domain name of DOMAIN1
and the email address of PERSON1.

	whois Full 

will return the PERSON1 record since it matches its contact
name.

If file /etc/swhoisd.header is present, it is printed at the beginning
of the message.  If file /etc/swhoisd.footer is present, it is printed
at the end of the message.


STARTING SWHOISD

Add a line similar to one of the lines below to /etc/inetd.conf,
depending on where the file is installed:

        whois   stream  tcp nowait root /usr/sbin/in.swhoisd       in.swhoisd
        whois   stream  tcp nowait root /usr/local/sbin/in.swhoisd in.swhoisd

Or, for xinetd.conf:

	service whois
	{
		socket_type	= stream
		wait		= no
		user		= nobody
		server		= /usr/sbin/in.swhoisd
		disable		= no
	#	log_type	= FILE /var/log/swhoisd.log
	}
	
Force inetd (or xinetd) to re-read it's configuration files with
kill -HUP or restart [x]inetd.

Make sure you edited file /etc/swhoisd.conf (see above for instructions)

And it's done.

The best way to figure it out is to give it a try.

See rfc1834.txt for information on whois servers.

swhoisd is based on source originally developed by
Joao Cabral <jcnc@dhis.org> and modified by Dan Anderson <dan@drydog.com>.
