/*
 * Copyright (C) 2002 Stichting NLnet, Netherlands, stichting@nlnet.nl.
 * 
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND STICHTING NLNET
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 * STICHTING NLNET BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
 * USE OR PERFORMANCE OF THIS SOFTWARE.
 * 
 * The development of Dynamically Loadable Zones (DLZ) for Bind 9 was
 * conceived and contributed by Rob Butler.
 * 
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the
 * above copyright notice and this permission notice appear in all
 * copies.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND ROB BUTLER
 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 * ROB BUTLER BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
 * USE OR PERFORMANCE OF THIS SOFTWARE.
 */

README

This is the eleventh release of the DLZ package.  It is meant to make
administration of Bind easier by moving all zone and record information out
of Bind's flat files and into a database.  What database?  Currently drivers
for PostgreSQL, MySQL, ODBC, LDAP, the file system and two for Berkeley DB are
available as part of the DLZ package.  The dlz_stub driver is also included
but should not be used except as an example to understand the principles
behind developing a DLZ driver using the SDLZ API.  As packaged, this patch
will NOT build any of the DLZ drivers or DLZ core by default.  Executing
configure without specifying any DLZ drivers will build Bind without any
DLZ code.  To enable DLZ you MUST pass parameters to configure specifying
which DLZ drivers to build.  When any of the DLZ drivers are built the DLZ
core will be built too.

Driver                     Configure parameter
PostgreSQL                 --with-dlz-postgres
MySQL                      --with-dlz-mysql
file system                --with-dlz-filesystem
both Berkeley DB drivers   --with-dlz-bdb
ODBC                       --with-dlz-odbc
LDAP                       --with-dlz-ldap
stub                       --with-dlz-stub

For more information on each driver, including additional configure parameters
or parameter options see the documentation for that particular driver.  Be
especially sure to check out the documentation for the Berkeley DB drivers, as
they have additional information you WILL NEED in order to build DLZ with the
Berkeley DB driver.

Be aware that the DLZ and SDLZ APIs may change in future releases as the
project develops.  The DLZ and SDLZ APIs have changed slightly between the
first release and the second release.  For more details on changes, read the
rest of this document and the changelog.txt document.

This code works on NT / 2K and Redhat Linux.  Other un*x's are probably fine
too.

NOTE: NEVER ATTEMPT TO BUILD BIND ON A FAT FILESYSTEM!
 
FAT filesystems do not appear to support hard links on Linux.  The Bind build
process uses a hard link for the lightweight resolver library (lwres).  Make
will encounter an error when trying to build lwres and stop without completing
a full build.  Named (the Bind name server) will have been built by this step,
but other utilities like rndc will not have been built.  Also, during a build
the only warnings you should get are:

cc1: warning: changing search order for system directory "/usr/include"
cc1: warning:   as it has already been specified as a non-system directory

Depending upon which drivers you are building DLZ with, you may not get these
warnings.  When building with Berkeley DB and one of the other drivers like
ODBC or PostgreSQL you will get this warning message.  It is simply informing
you that the search order for /usr/include has changed.  This is necessary
in order to get the Berkeley DB driver to build properly.  You should get no
other errors or warnings.

How to use this package is detailed below:

First, get Bind version 9.2.2 release from www.isc.org.  Newer versions
of Bind may be available, but this patch was built to go against the 9.2.2 
release.  Future versions of this package may be built to go against later
versions of Bind.  Unzip and untar that on your machine.  Once that is
finished, make sure your Bind source directory is called "bind-9.2.2".

Next, you need to apply the patch.  Make sure you are one level up from 
bind-9.2.2.  I.E. when you do "ls", bind-9.2.2 should be listed as a 
sub-directory.  To apply the patch, run this command "patch -p0 < dlz.patch"

cd to bind-9.2.2

Next run configure, make sure to specify which DLZ drivers you want built.
If you don't specify any bind will be built as normal.  i.e. no DLZ code or
drivers.

Examples:
for MySQL driver only           ./configure --with-dlz-mysql
for PostgreSQL driver only      ./configure --with-dlz-postgres
for File system driver only     ./configure --with-dlz-filesystem
for Berkeley DB drivers only    ./configure --with-dlz-bdb
for ODBC driver only            ./configure --with-dlz-odbc
for LDAP driver only            ./configure --with-dlz-ldap
for all 7 drivers               
./configure --with-dlz-mysql --with-dlz-postgres --with-dlz-filesystem --with-dlz-bdb --with-dlz-odbc --with-dlz-ldap

then run "make"  To save any errors to a file, run "make 2>stderr.txt" instead.

If things went well, you now have a patched Bind all ready to run and just
waiting for install.  If you used the second version of the make command you
can check stderr.txt for any problems.

If you have warnings like the ones below, it is ok:
->  cc1: warning: changing search order for system directory "/usr/include"
->  cc1: warning:   as it has already been specified as a non-system directory

To install, run "make install".  This should move Bind into the proper location
for your system.

Before you do, though, please note:

TEST THE SOFTWARE ON A NON-PRODUCTION SYSTEM FIRST!  Previous releases have
all included warnings not to use DLZ on a production system, as the code was
"early beta".  I.E. things had not be proven by a long track record of usage.
DLZ has been used for a while now with NO major complaints of problems, and
several bugs have been fixed.  DLZ should be considered somewhat safe for use
on a production system, but always test it on your hardware first!  The
bdbhpt driver is new in this release, and it should be considered beta
quality.

Make sure your root--Bind has to run as root.
                
Then run named -g -c path/to/your/named.conf

The -g option shows all log info on screen instead of saving to a log 
file.  -c indicates that you are going to tell Bind where to find the 
config file instead of letting it find it.

I hope DLZ makes Bind administration easier for you.  To make DLZ even
better, here's what I need from you.  FEEDBACK!!  Lots and lots of 
feedback.

What platform you are running the DLZ on?
How do DLZ and the drivers work for you?
What databases are you using with DLZ?
If you plan on developing a driver, take a look at the API and documentation.
If you don't understand something, ASK.  Hopefully, I can make the
documentation better and clearer next time.

Please try this out on as many different platforms and configurations as 
you can.  I want to know if, where, and why this thing breaks so I can fix it.
Most of all, just let me know what you think about DLZ.

Thanks
Rob
