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