[Pdns-users] Understanding powerdns zone id and tinydns backend

Peter van Dijk peter.van.dijk at powerdns.com
Fri Aug 9 14:59:22 UTC 2024


On Tue, 2024-07-30 at 13:44 +0200, subscryer--- via Pdns-users wrote:
> Hello everyone,
> I'm new to powerdns, I have switched from tinydns because of issues with 
> recent bind secondaries.
> The switch has been really straighforward, at least on the surface, as 
> pdns answers every type of query correctly.
> I'm using the tinydns backend, I've got a single cdb database, compiled 
> from a few different source files.
> 
> I'm experiencing some problems.
> 
> The first thing I noticed is that I'm unable to send notify to 
> secondaries, after some investigation I understood that each zone needs 
> to be set to primary for this to happen.

All zones in your cdb are primary automatically, beacuse there's no way
to store this information. The design of tinydns (which I loved, by the
way) somewhat limits our abilities here.

> Also, if I try to force it via pdns_control notify I get No such domain 
> xxx in our database, despite pdns_control list-zones being flawless.

That's interesting and might be worth an issue ticket on GitHub.

> So, I launched pdnsutil check-all-zones and I discovered that for every 
> zone I get:
> [Error] Unable to get zone information for zone 'xxx'
> Also, for every zone after the first I get:
> [Error] Zone ID 4294967295 of 'xxx' in backend tinydns has already been 
> used by zone 'firstzone' in backend tinydns.
> 
> I've been unable to determine how pdns assigns zone IDs.

Because, like mentioned above, there's no way to store additional
information, we fake it and give all domains ID -1. This mostly works,
but clearly you found a few corners that fail.

In a long standing PowerDNS tradition, the code has a comment pointing at
the pain:

      di.id = -1; //TODO: Check if this is ok.

> Regarding zone IDs I assume I may have to split the database so that 
> each zone is in a separate file?

There are no upsides to doing this, and it will not solve the ID problem.

>  This is less than desirable as one nice 
> thing about tinydns format is that you define forward and reverse 
> records with a single line whenever you need to, keeping things nicely 
> in sync. Essentially I'd have to butcher my config files.
> Is there a way to assign several zone IDs keeping one source cdb?

Not currently no.

> Also, I assume that if I migrate from tinydns to, say, sqlite, I may be 
> able to run queries on the db to have separate zone IDs even in the case 
> that the migration script doesn't handle them in the first place. 
> However from what I've read that format will not support per-record 
> comments, which I'd rather keep for administrative reasons and a sql db 
> is not as "human readable" as a text file (a lesser evil, but still I'd 
> avoid it if possible).

I suspect pdnsutil b2b-migrate will even assign per-zone IDs for you
immediately. The SQL backends do have per-RRset comments, but indeed, not
as convenient as a text file.


Kind regards,
-- 
Peter van Dijk
PowerDNS.com B.V. - https://www.powerdns.com/


More information about the Pdns-users mailing list