[Pdns-users] Documentation on populating backend database tables

Maik Zumstrull maik at zumstrull.net
Sun Apr 24 11:11:32 UTC 2011


On Sun, Apr 24, 2011 at 09:32, Sebastian Tennant <sebyte at smolny.plus.com> wrote:

> There are a couple of questions in there:
>
>  1. Does records.domain_id need to reference domains.id?  The manual says that
>    each domain *must* have a unique domain_id, yet the default value is NULL?

Yes. This has an implied foreign key constraint, but it's up to you to
actually define one on the database level. It also should be NOT NULL.

As you apparently noticed, the example schema in the documentation is
not all that great. The authors are aware of this.

>  2. Does 'type' (used in the records table schema) mean 'qtype' (used in the
>    manual)?

Yes.

> My attempt to answer them:
>
>  1. Doesn't matter in a simple use case like mine.

The information which records are members of the same zone is
important, and can not entirely be derived from the owner name. If you
don't define zones correctly, PowerDNS will give incorrect replies in
some cases. But yes, very simple stuff like asking for an A record
that you are authoritative for and that exists would work.

> Better still, as mine is such a simple use case, can you not just tell me
> whether or not these four INSERTS will do the job the comments optimistically
> claim they do:
>
> --8<---------------cut here---------------start------------->8---
>  -- create nameservers
>  INSERT INTO records (id, name, type, content, ttl) VALUES
>  (1, 'foo.net', 'NS', 'ns1.foo.net', 25920);
>  INSERT INTO records (id, name, type, content, ttl) VALUES
>  (2, 'foo.net', 'NS', 'ns2.foo.net', 25920);
>
>  -- publish ip addresses of nameservers
>  INSERT INTO records (id, name, type, content, ttl) VALUES
>  (3, 'ns1.foo.net', 'A', '207.210.96.211', 8640);
>  INSERT INTO records (id, name, type, content, ttl) VALUES
>  (4, 'ns2.foo.net', 'A', '207.210.106.146', 8640);
> --8<---------------cut here---------------end--------------->8---
>
> Do I need to do any more thatn this?

A SOA record is required, or PowerDNS will not answer correctly for
non-existent records. Also, see above regarding correct zone
membership information.



More information about the Pdns-users mailing list