README for swhoisd 2.0
=====================

	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.

	The best way to figure 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>.
	See file COPYRIGHT for copyright and license restrictions.

	Feel free to email me at <dan@drydog.com> with any questions
	or suggestions.
