a2a915
			PGSQL BIND SDB driver
a2a915
a2a915
The postgresql BIND SDB driver is of experimental status and should not be 
a2a915
used for production systems.
a2a915
a2a915
Usage:
a2a915
a2a915
o Use the named_sdb process ( put ENABLE_SDB=yes in /etc/sysconfig/named )
a2a915
a2a915
o Edit your named.conf to contain a database zone, eg. :
a2a915
  
a2a915
zone "pgdb.net." IN {
a2a915
        type master;
a2a915
        database "pgsql  bind        pgdb     localhost pguser pgpasswd";
a2a915
        #                ^- DB name  ^-Table  ^-host    ^-user ^-password
a2a915
};
a2a915
a2a915
o Create the database zone table
a2a915
  The table must contain the columns "name", "rdtype", and "rdata", and
a2a915
  is expected to contain a properly constructed zone.  The program "zonetodb"
a2a915
  creates such a table.
a2a915
  
a2a915
  zonetodb usage:
a2a915
    
a2a915
    zonetodb origin file dbname dbtable
a2a915
a2a915
    where
a2a915
	origin : zone origin, eg "pgdb.net."
a2a915
	file   : master zone database file, eg. pgdb.net.db
a2a915
	dbname : name of postgresql database 
a2a915
        dbtable: name of table in database
a2a915
a2a915
    Eg. to import this zone in the file 'pgdb.net.db' into the 'bind' database 
a2a915
        'pgdb' table:
a2a915
a2a915
---
a2a915
#pgdb.net.db:
a2a915
$TTL 1H
a2a915
@       SOA     localhost.      root.localhost. (       1
a2a915
                                                3H
a2a915
                                                1H
a2a915
                                                1W
a2a915
                                                1H )
a2a915
        NS      localhost.
a2a915
host1   A       192.168.2.1
a2a915
host2   A       192.168.2.2
a2a915
host3   A       192.168.2.3
a2a915
host4   A       192.168.2.4
a2a915
host5   A       192.168.2.5
a2a915
host6   A       192.168.2.6
a2a915
host7   A       192.168.2.7
a2a915
---
a2a915
a2a915
Issue this command as the pgsql user authorized to update the bind database:
a2a915
 
a2a915
# zonetodb pgdb.net. pgdb.net.db bind pgdb
a2a915
a2a915
will create / update the pgdb table in the 'bind' db:
a2a915
a2a915
$ psql -dbind -c 'select * from pgdb;'
a2a915
      name      | ttl  | rdtype |                        rdata
a2a915
----------------+------+--------+-----------------------------------------------------
a2a915
 pgdb.net       | 3600 | SOA    | localhost. root.localhost. 1 10800 3600 604800 3600
a2a915
 pgdb.net       | 3600 | NS     | localhost.
a2a915
 host1.pgdb.net | 3600 | A      | 192.168.2.1
a2a915
 host2.pgdb.net | 3600 | A      | 192.168.2.2
a2a915
 host3.pgdb.net | 3600 | A      | 192.168.2.3
a2a915
 host4.pgdb.net | 3600 | A      | 192.168.2.4
a2a915
 host5.pgdb.net | 3600 | A      | 192.168.2.5
a2a915
 host6.pgdb.net | 3600 | A      | 192.168.2.6
a2a915
 host7.pgdb.net | 3600 | A      | 192.168.2.7
a2a915
(9 rows)
a2a915
a2a915
I've tested exactly the above configuration with bind-sdb-9.3.1+ and it works OK.
a2a915
a2a915
NOTE: If you use pgsqldb SDB, ensure the postgresql service is started before the named
a2a915
      service .
a2a915
a2a915
USE AT YOUR OWN RISK!