[Pdns-dev] allowing usage of --start-id in conjunction with --zone

Maysara A. Abdulhaq maysara.abdulhaq at gmail.com
Sun Mar 29 23:32:24 CEST 2009


Hello,

I needed to be able to set the --start-id when processing chunks of of
zones (usually SOA less chunks), but the version i am using
(pdns-2.9.21.1.0 from ubuntu) do not support this, and if the zone is
SOA-less, i get domain ID value of -1 ; i have posted this on the
users mailing list [1], also a post by Augie Schwer raised similar
issue back in 2006 [2]. anyway, i did a small modification (one line
actually) that got things working for me, and also solves the issue
Augie Schwer posted, i hope this can be added to next releases that
include zone2sql if it doesn't break anything. it basically checks
whether  the start-id is set, if not(or is set to 0), it preserves the
old behavior, if it is set, it uses the new value and does not set it
to -1,here is a patch:

--- zone2sql.cc	2008-08-08 00:28:12.000000000 +0300
+++ zone2sql.cc	2009-03-29 22:08:16.000000000 +0300
@@ -290,7 +290,8 @@
     else {
       ZoneParserTNG zpt(zonefile, arg()["zone-name"]);
       DNSResourceRecord rr;
-      dirty_hack_num=-1; // trigger first SOA output
+      if(!arg()["start-id"].compare("0"))
+        dirty_hack_num=-1; // trigger first SOA output
       while(zpt.get(rr))
 	callback(0, rr.qname, rr.qtype.getName(), rr.content, rr.ttl, rr.priority);



[1] http://mailman.powerdns.com/pipermail/pdns-users/2009-March/005996.html
[2] http://mailman.powerdns.com/pipermail/pdns-users/2006-June/003545.html

Thank you for this great piece of software,
--
Maysara A. A.


More information about the Pdns-dev mailing list