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