[Pdns-users] Bind to pdns: A few remarks/questions

Rudolph Bott rb at megabit.net
Sun Jan 27 16:47:18 UTC 2008

Hugo van der Kooij schrieb:
> Hash: SHA1
> Hi,
> I got the logging bit. But the transition is running into some odd
> things. Part of which is bind acting up and that was the prime reason
> for moving away from bind.
> ~ 1. It seems bind was happy with $ttl in a zone file but zone2sql fails
> on it. Someone might want to trigger just a warning instead of a failure
> if that happens.
> ~ 2. I notice that zone2sql always makes a zone NATIVE where I guess some
> people may want to make them MASTER instead. Not a big issue but one
> might make it user selectable.
> ~ 3. I do not understand the bit in the appendix (A.5.1) about:
> CONSTRAINT `records_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES
> `domains` (`id`) ON DELETE CASCADE
If you use the gmysql backend and InnoDB as table engine, you can use 
the foreign-keys support in MySQL. The statement above "connects" the 
key domain_id in the records table to the primary key "id" in the 
domains table.
When you try to delete a domain from the domains table, all entries in 
the records table that reference this domain via domain_id will be 
deleted, too. This prevents stray entries in the records table and keeps 
your relations constistent - if you don't use this feature (e.g. because 
you use the MyIsam table engine) you have to make sure that your 
dns/database management tool takes care of deleting those records.

> Unfortunatly my prime expert for database matters was a brother that
> should have celebrated his 47th birthday today. So I need to direct
> those questions elsewhere now.
> ~ 4. Are names supposed to end with a dot if they are relative names?
> In bind I have lines like:
> anfalas                 IN      AAAA    2001:888:10fa::1
> anfalas.ipv6            IN      AAAA    2001:888:10fa::1
> anfalas                 IN      A
> anfalas.ipv4            IN      A
> But in pdns this gets converted to:
> anfalas.                3600    IN      AAAA    2001:888:10fa::1
> anfalas.ipv6.           3600    IN      AAAA    2001:888:10fa::1
> anfalas.                3600    IN      A
> anfalas.ipv4.           3600    IN      A
> I would guess this is an error on the side of the zone2sql program as it
> creates these entries with a dot. I was under the distinct impression
> that an ending dot means it is an absolute name and not one relative to
> the zone.
I'm not exactly sure but I *think* that you have to provide the name of 
the zone as command line parameter when you use zone2sql to do the 
conversion. In my case I had a folder full of bind zone files where the 
file names represented the domain. So I did something like:

for i in *
  zone2sql --gmysql --zone=$i --zone-name=$i

Put that in a simple shell script and redirect its output in some 
zones.sql (or whatever) file. As far as I can remember this is what 
worked for me!

> Hugo.
> - --
> hvdkooij at vanderkooij.org               http://hugo.vanderkooij.org/
> PGP/GPG? Use: http://hugo.vanderkooij.org/0x58F19981.asc
>     A: Yes.
>     >Q: Are you sure?
>     >>A: Because it reverses the logical flow of conversation.
>     >>>Q: Why is top posting frowned upon?
> Bored? Click on http://spamornot.org/ and rate those images.
> Version: GnuPG v1.4.7 (GNU/Linux)
> iD8DBQFHnLA7BvzDRVjxmYERAv5GAJ9cnY6a0aMmgcw6tmIbc00Aslt0oQCfeV5S
> OsElwR8GVw6rxk46yp7/E5A=
> =sfjp
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> http://mailman.powerdns.com/mailman/listinfo/pdns-users

More information about the Pdns-users mailing list