Help on rwhois - and script.
Keri Medei
medei at web-ink.com
Mon Sep 27 17:55:59 EDT 1999
Ok, since I've finally been able to get rwhois to work the way that my
company needs it to, along with write a document on how to set it up, and
even took the time to write a script to do this automagickally, I'm going
to post it here.
These two files are going to be located at the following:
http://www.web-ink.com/rwhois/basicsetup
http://www.web-ink.com/rwhois/rwhois-script.tar.gz
If I've made any mistakes, please let me know, and I'll fix them.
Keri Medei
-----BEGIN GEEK CODE BLOCK-----
GE d--- s: a- C+++ UBL++++$ P+ L++ E- W+++$ N+ o K++ w O- M--
V- PS++(+++) PE+ Y+ PGP- t+ 5 X+ R+++$ tv+ b+++ DI++ D+ G++ e
h* r x+
------END GEEK CODE BLOCK------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 7833 bytes
Desc:
Url : http://lists.verisignlabs.com/pipermail/rwhois/attachments/19990927/e998d925/attachment.obj
-------------- next part --------------
Rwhoisd Setup and Use for getting more IP address from ARIN
Keri Medei - 09-27-1999 (keri at medei.com)
Thanks to John Newman, Greg Fausak, David Huberman, Martin
Oldfield, Omar Thameen, and the rwhois mailing list members
for their help and advice.
-------------------------------------------------------------
An RWHOIS server, should, at the least, include the assignment
size, the organization name, the organization's postal address
(not your postal address), and an e-mail address or ARIN Handle
for the technical POC of the organization recieving the
reassignment.
(David R. Huberman from ARIN 9/9/99)
--------------------------------------------------------------
This is the best way that I've found to keep it secure, and
make it easy to set up.
1. Get the rwhois server daemon (latest release at this time
is 1.5.3)
2. Gunzip/untar the file, and move the resulting rwhoisd-1.5.3
directory to /usr/local/rwhoisd (or someplace similar)
3. Create a user rwhois on the server, setting their home dir
as /usr/local/rwhoisd
4. Compile the source, ./compile; make; make install
5. Start altering files....
--------------------------------------------------------------
1. rwhoisd.conf - needs to be altered to the correct settings
of your own server. It basically tells the daemon where
to go for certain files, or log other things. Once you've gotten
this configured properly, you shouldn't need to touch it again.
2. rwhoisd.allow and rwhoisd.deny - if you only want to allow
queries to your server from certain places. I haven't found any
problems with leaving it as it is.
3. rwhoisd.auth_area - Now it gets interesting. You'll have two
entries in there already.
type: master
name: a.com
data-dir: a.com/data
schema-file: a.com/schema
soa-file: a.com/soa
---
type: master
name: 10.0.0.0/8
data-dir: net-10.0.0.0-8/data
schema-file: net-10.0.0.0-8/schema
soa-file: net-10.0.0.0-8/soa
Lets say I have the netblock 209.50.123.0/23 (two class c's) that
I've given out to Luser Inc. Luser Inc. has their own domain name
(at least I'd hope so) named luser.com . So, in my
rwhoisd.auth_area file, I'd need to put in two entries.
type: master
name: luser.com
data-dir: luser.com/data
schema-file: luser.com/schema
soa-file: luser.com/soa
---
type: master
name: 209.50.123.0/23
data-dir: net-209.50.123.0-23/data
schema-file: net-209.50.123.0-23/schema
soa-file: net-209.50.123.0-23/soa
Note the --- that separates each entry. If you don't put that in,
or you put an extra one in, it's going to come up with errors.
4. Next, you'll need to make those directories, by copying the
a.com directory to luser.com and net-10.0.0.0-8 to
net-209.50.123.0-23
5. Altering those files. Starting with net-209.50.123.0-23
A. soa - Start of Authority.
1. Serial-Number: usually the date w/ 9 0's
2. Primary-Server: name of your server:4321
3. Hostmaster: email of editor, usually
B. schema - What you want it to look for. Note the
difference between the a.com/schema files and the
net-IPaddress/schema. I've only needed to alter the
two that are there already.
1. network - information concerning the IP
address space I'm giving luser.com to use
2. referral - where to look if there's no
information, or more information.
For each one of these, just change the ip address
over to the correct one, and alter the Schema-Version
to show the date.
C. attribute_defs directory - You shouldn't need to
alter files in here, only copy templates over from
other directories. If you add anything to your schema
file, you will need to copy the corresponding .tmpl from
the a.com/attribute_defs directory into this one.
D. data - for each entry that you have in your schema
file, you will need a directory that matches up. So,
for net-209.50.123.0-23/data/ I have two directories,
network and referral.
1. network/network.txt
ID: 666.10.0.0.0/8
Auth-Area: 10.0.0.0/8
Network-Name: A-NET
IP-Network: 10.0.0.0/8
Organization:777.a.com
Tech-Contact:222.a.com
Admin-Contact:223.a.com
Created: 19961022
Updated: 19961023
Updated-By: hostmaster at a.com
I've found it easier to put in names instead
of numbers for contacts and such.
ID: LUSER.209.50.123.0/23
Auth-Area: 209.50.123.0/23
Network-Name: LUSER
IP-Network: 209.50.123.0/23
Organization: org.luser.com
Tech-Contact: tech at luser.com
Admin-Contact: admin at luser.com
Created: 19990927
Updated: 19990927
Updated-By: noc at mycompany.com
NOTE: Tech-Contact and Admin-Contact can also
point to something like tech.luser.com or
even tech.othercompany.com (you'll have to
have the information for othercompany.com
in your files, though)
2. referral/referral.txt - I've not found a need
for changing this, mostly because I'm only running
one RWHOIS server.
That's really basic, mostly because you're only showing that
the IP address space is being used. You aren't showing by whom.
6. Altering files, continued, now in luser.com directory.
A. soa, just like before
B. schema, just like before (note the many entries)
C. attribute_defs, no need to touch those.
D. data directory.
Ok, here's where it gets interesting. Right off the bat,
there's 7 files/directories to choose from, depending on
how indepth you need/want to be in the information you're
making available to the rest of the world. I'm only going
to explain two.
The very basics of what ARIN wants requires really only
one file in here, org/org.txt.
1. org/org.txt
ID: org.luser.com
Auth-Area: luser.com
Org-Name: Luser Inc.
Street-Address: 123 Main St.
City: McLean
State: VA
Postal-Code: 22102
Country-Code: US
Phone: 800-555-1212
Created: 19990927
Updated: 19990927
Updated-By: hostmaster at mycompany.com
NOTE: if you put in something other then an email
address or ARIN handle for the tech and admin
contacts in net-209.50.123.0-23/network/network.txt
then you'll need to do this.
2. contact/contact.txt
ID:tech.luser.com
Auth-Area:luser.com
Name:Joe Shmoe
Email:tech at luser.com
Type:I
First-Name:Joe
Last-Name:Schmoe
Phone:800-555-1213
Fax:800-555-1214
Organization:org.luser.com
Created:19990927
Updated:19990927
Updated-By: hostmaster at mycompany.com
Remember, if you have more then one entry in
the org.txt file, you'll need to separate them
with ---
--------------------------------------------------------------
After you've finished putting in this information, you'll need to
index it. There have been several quick shell scripts that have been
written to do this, I made my own, which indexes network information
and organization information in two different steps (since it seems to
balk at doing it all at once).
This script will remove the .ndx and .db files that might be there
already from the last indexing, and then make new ones with the
current information.
#!/bin/sh
# cleanup rwhois dictionary files
echo 'cleanup in process'
find . \( -name index\* -o -name local* -o -name \*.txt.\* \) -print |\
xargs rm -f
# reindex both organizational and network
echo 'reindexing network information'
/usr/local/rwhoisd/bin/rwhois_indexer -C network -i -v -s txt
echo 'reindexing organizational information'
/usr/local/rwhoisd/bin/rwhois_indexer -C organization -i -v -s txt
# This assumes that you are already running the rwhois daemon.
# change this, depending on what OS you are using.
echo 'ps auxw|grep rwhois |kill -HUP *process number*'
--------------------------------------------------------------
To start the rwhois server up to begin with, you'll need to type in:
/usr/local/rwhoisd/etc/rwhoisd -c /usr/local/rwhoisd/rwhoisd.conf
(assuming that you're using the same setup that I am)
--------------------------------------------------------------
I've made a script that does this particular thing automatically,
and that is located at http://www.web-ink.com/rwhois/rwhois-script.tar.gz
Please let me know if this document needs corrections,
Keri
More information about the Rwhois
mailing list