]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
BIND backend: support "native" zones 5115/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Mon, 6 Mar 2017 14:43:18 +0000 (15:43 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Mon, 6 Mar 2017 14:57:42 +0000 (15:57 +0100)
Allow the use of `type native;` for zones in BIND config files. We also
assume the type is native if no type is specified.

Closes #1284

docs/markdown/authoritative/backend-bind.md
modules/bindbackend/bindbackend2.cc

index 51340c046fb42441fdb4cc90020df153c4ca5b49..05e0515a78e6556137bcdeb94f8672ab8ebf7779 100644 (file)
@@ -85,7 +85,7 @@ its own. Furthermore, on most systems, there will be no benefit in using multipl
 CPUs for the packetcache, so a noticeable speedup can be attained by specifying
 [`distributor-threads`](settings.md#distributor-threads)`=1` in `pdns.conf`.
 
-## Master/slave configuration
+## Master/slave/native configuration
 
 ### Master
 Works as expected. At startup, no notification storm is performed as this is
@@ -103,3 +103,11 @@ parsed only then.
 
 In the future, this may be improved so the old zone remains available should
 parsing fail.
+
+### Native
+PowerDNS has the concept of "native" zones that have the `type native;` in the BIND configuration file.
+These zones are neither a master (no notifies are sent) nor a slave zone (it will never be AXFR'd in).
+This means that the replication mechanism for these zone is not AXFR but out of band, e.g. using `rsync`.
+Changes to native zones are picked up in the same way as master and slave zones, see [Operation](#operation).
+
+**note**: Any zone with no `type` set (an error in BIND) is assumed to be native.
index 774a5a3bfd03b319b73bbb716ce6ebcbe47908de..9e7645adc3862df3f3f5e8587fd8d0b1589bd774 100644 (file)
@@ -809,12 +809,9 @@ void Bind2Backend::loadConfig(string* status)
         i!=domains.end();
         ++i) 
       {
-        if(i->type == "") {
-          L<<Logger::Warning<<d_logprefix<<" Warning! Skipping zone '"<<i->name<<"' because it has no type specified"<<endl;
-          rejected++;
-          continue;
-        }
-        if(i->type!="master" && i->type!="slave") {
+        if(i->type == "")
+          L<<Logger::Notice<<d_logprefix<<" Zone '"<<i->name<<"' has no type specified, assuming 'native'"<<endl;
+        if(i->type!="master" && i->type!="slave" && i->type != "native" && i->type != "") {
           L<<Logger::Warning<<d_logprefix<<" Warning! Skipping zone '"<<i->name<<"' because type '"<<i->type<<"' is invalid"<<endl;
           rejected++;
           continue;