Bug 171226 - No documentation or example on bind-sdb with postgresql
No documentation or example on bind-sdb with postgresql
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: bind (Show other bugs)
4
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Stransky
Ben Levenson
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-19 12:40 EDT by William Caban
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: FC5
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-21 22:14:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description William Caban 2005-10-19 12:40:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Description of problem:
Even when bind-sdb says it support pgsqldb there is no documentation, man page or example on how to configure it to use any other database besides LDAP.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
> rpm -qd bind-sdb-9.3.1
/usr/share/doc/bind-sdb-9.3.1/INSTALL.ldap
/usr/share/doc/bind-sdb-9.3.1/README.ldap
/usr/share/man/man1/zone2ldap.1.gz


Expected Results:  Have some INSTALL.pgsqldb or README.pgsqldb or at least README.sql

Additional info:
Comment 1 Jason Vas Dias 2005-10-19 14:29:00 EDT
Yes, no documentation is shipped by the upstream developers for the pgsql SDB .

Indeed, this SDB is of experimental status, as indicated by the comment in the 
code (contrib/sdb/pgsql/pgsqldb.c) :

/*
 * A simple database driver that interfaces to a PostgreSQL database.  This
 * is not complete, and not designed for general use.  It opens one
 * connection to the database per zone, which is inefficient.  It also may
 * not handle quoting correctly. ...
 */

It also seems to be unmaintained (it did not work at all until I patched it
for BIND 9 compatibility ...).

I don't think we should encourage the use of this experimental feature by
providing man-pages for it.

I will, however, ship a  /usr/share/doc/bind-sdb*/README.pgsqldb file in 
the next release, containing eg.:


"PGSQL BIND SDB driver

This BIND SDB for postgresql is of experimental status and should not be 
used for production systems.

Usage:

o Use the named_sdb process ( put ENABLE_SDB=yes in /etc/sysconfig/named )

o Edit your named.conf to contain a database zone, eg. :
  
zone "pgdb.net." IN {
        type master;
        database "pgsql  bind        pgdb     localhost pguser pgpasswd";
        #                ^- DB name  ^-Table  ^-host    ^-user ^-password
};

o Create the database zone table
  The table must contain the fields "name", "rdtype", and "rdata", and
  is expected to contain a properly constructed zone.  The program "zonetodb"
  creates such a table.
  
  zonetodb usage:
    With a DNS master zone database file 'zone.db' containing the zone to 
    import, and being a user allowed to connect to the postgresql database
    and update it:
    zonetodb origin file dbname dbtable

    Eg. to import this zone in the file 'pgdb.net.db':

---
#pgdb.net.db:
$TTL 1H
@       SOA     localhost.      root.localhost. (       1
                                                3H
                                                1H
                                                1W
                                                1H )
        NS      localhost.
host1   A       192.168.2.1
host2   A       192.168.2.2
host3   A       192.168.2.3
host4   A       192.168.2.4
host5   A       192.168.2.5
host6   A       192.168.2.6
host7   A       192.168.2.7
---

  into database 'bind' table 'pgdb' :  
 
# zonetodb pgdb.net. pgdb.net.db bind pgdb

will create / update the pgdb table in the 'bind' db:

$ psql -dbind -c 'select * from pgdb;'
      name      | ttl  | rdtype |                        rdata
----------------+------+--------+-----------------------------------------------------
 pgdb.net       | 3600 | SOA    | localhost. root.localhost. 1 10800 3600 604800
3600
 pgdb.net       | 3600 | NS     | localhost.
 host1.pgdb.net | 3600 | A      | 192.168.2.1
 host2.pgdb.net | 3600 | A      | 192.168.2.2
 host3.pgdb.net | 3600 | A      | 192.168.2.3
 host4.pgdb.net | 3600 | A      | 192.168.2.4
 host5.pgdb.net | 3600 | A      | 192.168.2.5
 host6.pgdb.net | 3600 | A      | 192.168.2.6
 host7.pgdb.net | 3600 | A      | 192.168.2.7
(9 rows)

I've tested exactly the above configuration with bind-sdb-9.3.1+ and it works OK.

USE AT YOUR OWN RISK!
Comment 2 Jason Vas Dias 2005-10-19 18:33:29 EDT
This is now fixed with bind-9.3.1-20 (FC5) and bind-9.3.1-14_FC4 .
Comment 3 William Caban 2005-10-21 15:13:07 EDT
For some reason the zonetodb is not working for me.

> zonetodb pgdb.net. pgdb.net.db bind pgdb

it display the following error:

"dns_name_fromtext: empty label"

-W
Comment 4 Jason Vas Dias 2005-10-21 15:33:28 EDT
You must have a problem with your zone database file - specifically, an 
"empty label" or a record that cannot be associated with a dns name. 

With EXACTLY this zone database file:
'$TTL 1H
@       SOA     localhost.      root.localhost. (       1
                                                3H
                                                1H
                                                1W
                                                1H )
        NS      localhost.
host1   A       192.168.2.1
host2   A       192.168.2.2
host3   A       192.168.2.3
host4   A       192.168.2.4
host5   A       192.168.2.5
host6   A       192.168.2.6
host7   A       192.168.2.7
'

I run this command, and it returns the following output OK :

$ /usr/sbin/zonetodb pgdb.net. pgdb.net.db bind pgdb
Connecting to 'bind'
DROP TABLE pgdb
BEGIN
CREATE TABLE pgdb (NAME TEXT, TTL INTEGER, RDTYPE TEXT, RDATA TEXT)
INSERT INTO pgdb (NAME, TTL, RDTYPE, RDATA) VALUES ('pgdb.net', 3600, 'SOA',
'localhost. root.localhost. 1 10800 3600 604800 3600')
INSERT INTO pgdb (NAME, TTL, RDTYPE, RDATA) VALUES ('pgdb.net', 3600, 'NS',
'localhost.')
INSERT INTO pgdb (NAME, TTL, RDTYPE, RDATA) VALUES ('host1.pgdb.net', 3600, 'A',
'192.168.2.1')
INSERT INTO pgdb (NAME, TTL, RDTYPE, RDATA) VALUES ('host2.pgdb.net', 3600, 'A',
'192.168.2.2')
INSERT INTO pgdb (NAME, TTL, RDTYPE, RDATA) VALUES ('host3.pgdb.net', 3600, 'A',
'192.168.2.3')
INSERT INTO pgdb (NAME, TTL, RDTYPE, RDATA) VALUES ('host4.pgdb.net', 3600, 'A',
'192.168.2.4')
INSERT INTO pgdb (NAME, TTL, RDTYPE, RDATA) VALUES ('host5.pgdb.net', 3600, 'A',
'192.168.2.5')
INSERT INTO pgdb (NAME, TTL, RDTYPE, RDATA) VALUES ('host6.pgdb.net', 3600, 'A',
'192.168.2.6')
INSERT INTO pgdb (NAME, TTL, RDTYPE, RDATA) VALUES ('host7.pgdb.net', 3600, 'A',
'192.168.2.7')
COMMIT TRANSACTION

Please append the pgdb.net.db file you are using and I'll tell you what's wrong
with it .

You could also insert it in your named.conf configuration as 
  'zone "pgdb.net." { type master; file "pgdb.net.db"; }'
and run 
# named-checkconf -z
and this also should tell you what is the problem with pgdb.net.db .

Comment 5 William Caban 2005-10-21 16:27:33 EDT
There was a special character hidden in the file at the end of one of the lines.
Comment 6 Bill Nottingham 2006-09-21 22:14:44 EDT
Closing bugs in MODIFIED state from prior Fedora releases. If this bug persists
in a current Fedora release (such as Fedora Core 5 or later), please reopen and
set the version appropriately.

Note You need to log in before you can comment on or make changes to this bug.