
			    CACHEBUILD

			    Version 1.2

	  A Domain Name Server root.cache Building Utility

	 	By: Paul Balyoz <Paul.Balyoz@nau.edu>
              Copyright (c) 1993-1995 by Paul A. Balyoz


DESCRIPTION

This utility will build the latest root domain server cache for your
BIND nameserver data base, by running nslookup to query one of the known
root domain servers, and passing the output through an awk script to
generate the file.  Simple, really.

Of course, your name server's current root.cache must have at least
ONE working root domain server and its address, or you can't get to
a root server to ask about other root servers.  (But then, you'd know
it by now, your nameserver wouldn't be working!)  This will build a more
up-to-date root.cache than the one that comes with the BIND distribution.

Run cachebuild every month or two to keep your nameserver up to date.
You can even run it from cron if you're brave.

Cachebuild should NOT be run on root name servers themselves --
those sites are much too important to trust automated software!
Cachebuild is intended to be used by normal Internet sites.


HOW IT WORKS

The file "root.cache" is created in your currently directory when
cachebuild is run.  Don't worry though, if there's an existing file
by that name it will be moved to "root.cache.old" (and similarly,
an existing file by that name is moved to "root.cache.older").

There's no guarantee that the output from this program is correct;
after you generate a new root.cache file, examine it carefully and
compare it with your old one.  Keep your old root.cache files around,
just in case!

The only challenge is adjusting the awk script to work with the version
of BIND that you happen to have installed.  The awk script included
works with nslookup from BIND version 4.8.3 and from SunOS 4.1.3.
You can modify it as needed.


INSTALLATION

1.  Edit the Makefile, and adjust as needed for your local site.

2.  Edit cachebuild.SH, and adjust the PATH variable as needed.

3.  Type "make" to build the shell script cachebuild.

4.  Type "make install" to install the program and awk script.

5.  Move into a safe place (cd /tmp) and try running cachebuild
    (type "cachebuild").  If you use the C-shell, you may need to type
    "rehash" first.  Cachebuild should create the file root.cache in
    your current directory.  Examine it.

6.  If all is OK, you can now run cachebuild in your name-server
    database directory or just copy the new root.cache over there.
    If not, fix it, "make clean" and try again.


ERROR MESSAGES

If it succeeds, cachebuild will return the usual exit status of 0.
The only error message cachebuild generates is:

		Call to nslookup failed.

which means that nslookup exited with a non-zero status value
(indicating an error of some sort).  Error messages from nslookup
that are sent to stderr will come out on stderr from cachebuild, too.


FUTURE ENHANCEMENTS

Cachebuild would be better if it was rewritten to use DiG instead of
Nslookup.  There are different versions of Nslookup with different
output formats, none of which correspond directly to how the records
are actually stored.  And parsing nslookup output from a program is no
easy task!  However, not every site has DiG, while Nslookup comes with
all versions of Bind -- and most Unix systems today.  To minimize
dependencies on outside software, we chose to use nslookup.


COMPLAINTS DEPARTMENT

Yea, I know, I should rewrite it in perl.  ENOTIME.


--
Paul Balyoz, Senior Systems Programmer   root@rainbow.cse.nau.edu
Computer Science Department              Paul.Balyoz@nau.edu
Northern Arizona University              pab@rainbow.cse.nau.edu
PO Box 15600, Flagstaff AZ 86011, USA    pab@pine.cse.nau.edu
