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