]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Unify parental-agents, primaries to remote-servers
authorMatthijs Mekking <matthijs@isc.org>
Thu, 5 Dec 2024 07:52:03 +0000 (08:52 +0100)
committerMatthijs Mekking <matthijs@isc.org>
Fri, 13 Dec 2024 07:50:02 +0000 (08:50 +0100)
Having zone statements that are also top blocks is confusing, and if
we want to add more in the future (which I suspect will be for
generalized notifications, multi-signer), we need to duplicate a lot
of code.

Remove top blocks 'parental-agents' and 'primaries' and just have one
top block 'remote-servers' that you can refer to with zone statements.

26 files changed:
bin/named/config.c
bin/named/include/named/config.h
bin/named/server.c
bin/named/zoneconf.c
bin/tests/system/addzone/ns3/named1.conf.in
bin/tests/system/checkconf/bad-duplicate-primaries-2.conf [deleted file]
bin/tests/system/checkconf/bad-duplicate-remote-servers.conf [moved from bin/tests/system/checkconf/bad-duplicate-primaries-1.conf with 84% similarity]
bin/tests/system/checkconf/bad-parental-agents-def-view2.conf
bin/tests/system/checkconf/bad-parental-agents-dupdef.conf
bin/tests/system/checkconf/bad-parental-agents-empty.conf
bin/tests/system/checkconf/bad-parental-agents-notfound.conf
bin/tests/system/checkconf/bad-primaries-notfound.conf
bin/tests/system/checkconf/good-multiple-remote-servers.conf [moved from bin/tests/system/checkconf/good-masters-and-primaries.conf with 87% similarity]
bin/tests/system/checkconf/good.conf.in
bin/tests/system/checkconf/inline-bad.conf
bin/tests/system/checkconf/inline-good.conf
bin/tests/system/checkconf/inline-no.conf
bin/tests/system/checkds/ns9/named.conf.in
bin/tests/system/notify/ns2/named.conf.in
bin/tests/system/nsupdate/ns1/named.conf.in
bin/tests/system/xfer/ns2/named.conf.in
doc/arm/reference.rst
doc/dnssec-guide/signing.rst
doc/misc/options
lib/isccfg/check.c
lib/isccfg/namedconf.c

index 8aef22dddbe9c94935675699bf850c56ec9ded51..558f7d72cf735f9a8e45d04ddd59a3b3c23fd461 100644 (file)
@@ -331,7 +331,7 @@ dnssec-policy \"insecure\" {\n\
 
                            "# END TRUST ANCHORS\n\
 \n\
-primaries " DEFAULT_IANA_ROOT_ZONE_PRIMARIES " {\n\
+remote-servers " DEFAULT_IANA_ROOT_ZONE_PRIMARIES " {\n\
        2801:1b8:10::b;         # b.root-servers.net\n\
        2001:500:2::c;          # c.root-servers.net\n\
        2001:500:2f::f;         # f.root-servers.net\n\
@@ -503,9 +503,9 @@ named_config_getzonetype(const cfg_obj_t *zonetypeobj) {
        return ztype;
 }
 
-static isc_result_t
-getremotesdef(const cfg_obj_t *cctx, const char *list, const char *name,
-             const cfg_obj_t **ret) {
+isc_result_t
+named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
+                          const char *name, const cfg_obj_t **ret) {
        isc_result_t result;
        const cfg_obj_t *obj = NULL;
        const cfg_listelt_t *elt;
@@ -532,23 +532,6 @@ getremotesdef(const cfg_obj_t *cctx, const char *list, const char *name,
        return ISC_R_NOTFOUND;
 }
 
-isc_result_t
-named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
-                          const char *name, const cfg_obj_t **ret) {
-       isc_result_t result;
-
-       if (strcmp(list, "parental-agents") == 0) {
-               return getremotesdef(cctx, list, name, ret);
-       } else if (strcmp(list, "primaries") == 0) {
-               result = getremotesdef(cctx, list, name, ret);
-               if (result != ISC_R_SUCCESS) {
-                       result = getremotesdef(cctx, "masters", name, ret);
-               }
-               return result;
-       }
-       return ISC_R_NOTFOUND;
-}
-
 static isc_result_t
 named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
                     dns_name_t **namep) {
@@ -598,9 +581,8 @@ named_config_getname(isc_mem_t *mctx, const cfg_obj_t *obj,
        }
 
 isc_result_t
-named_config_getipandkeylist(const cfg_obj_t *config, const char *listtype,
-                            const cfg_obj_t *list, isc_mem_t *mctx,
-                            dns_ipkeylist_t *ipkl) {
+named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
+                            isc_mem_t *mctx, dns_ipkeylist_t *ipkl) {
        uint32_t addrcount = 0, srccount = 0;
        uint32_t keycount = 0, tlscount = 0;
        uint32_t listcount = 0, l = 0, i = 0;
@@ -683,8 +665,6 @@ newlist:
                isc_sockaddr_any6(&src6);
        }
 
-       result = ISC_R_NOMEMORY;
-
        element = cfg_list_first(addrlist);
 resume:
        for (; element != NULL; element = cfg_list_next(element)) {
@@ -715,11 +695,11 @@ resume:
                                continue;
                        }
                        list = NULL;
-                       tresult = named_config_getremotesdef(config, listtype,
-                                                            listname, &list);
+                       tresult = named_config_getremotesdef(
+                               config, "remote-servers", listname, &list);
                        if (tresult == ISC_R_NOTFOUND) {
                                cfg_obj_log(addr, ISC_LOG_ERROR,
-                                           "%s \"%s\" not found", listtype,
+                                           "remote-servers \"%s\" not found",
                                            listname);
 
                                result = tresult;
index c6ba4eae964194d8d3e4e71dabe76c355544b739..0be3b12b9bb2421c15fde4a27b6229f97337a130 100644 (file)
@@ -57,9 +57,8 @@ named_config_getremotesdef(const cfg_obj_t *cctx, const char *list,
                           const char *name, const cfg_obj_t **ret);
 
 isc_result_t
-named_config_getipandkeylist(const cfg_obj_t *config, const char *listtype,
-                            const cfg_obj_t *list, isc_mem_t *mctx,
-                            dns_ipkeylist_t *ipkl);
+named_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
+                            isc_mem_t *mctx, dns_ipkeylist_t *ipkl);
 
 isc_result_t
 named_config_getport(const cfg_obj_t *config, const char *type,
index cb78911a8aca642b78290f154bee79aa63d0aea1..e52e60f11f954c39249f2bac073592c58ac3d5a3 100644 (file)
@@ -2779,8 +2779,8 @@ configure_catz_zone(dns_view_t *view, dns_view_t *pview,
                obj = cfg_tuple_get(catz_obj, "default-primaries");
        }
        if (obj != NULL && cfg_obj_istuple(obj)) {
-               result = named_config_getipandkeylist(
-                       config, "primaries", obj, view->mctx, &opts->masters);
+               result = named_config_getipandkeylist(config, obj, view->mctx,
+                                                     &opts->masters);
        }
 
        obj = cfg_tuple_get(catz_obj, "in-memory");
index 0699fdb6b6ba00d0e39a888baca51c5ecd055caa..2e9b754f2f09dcb4dfda302265409b516c740557 100644 (file)
@@ -1273,8 +1273,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                        dns_ipkeylist_t ipkl;
                        dns_ipkeylist_init(&ipkl);
 
-                       CHECK(named_config_getipandkeylist(config, "primaries",
-                                                          obj, mctx, &ipkl));
+                       CHECK(named_config_getipandkeylist(config, obj, mctx,
+                                                          &ipkl));
                        dns_zone_setalsonotify(zone, ipkl.addrs, ipkl.sources,
                                               ipkl.keys, ipkl.tlss,
                                               ipkl.count);
@@ -1679,9 +1679,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                if (parentals != NULL) {
                        dns_ipkeylist_t ipkl;
                        dns_ipkeylist_init(&ipkl);
-                       CHECK(named_config_getipandkeylist(
-                               config, "parental-agents", parentals, mctx,
-                               &ipkl));
+                       CHECK(named_config_getipandkeylist(config, parentals,
+                                                          mctx, &ipkl));
                        dns_zone_setparentals(zone, ipkl.addrs, ipkl.sources,
                                              ipkl.keys, ipkl.tlss, ipkl.count);
                        dns_ipkeylist_clear(mctx, &ipkl);
@@ -1861,8 +1860,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                        dns_ipkeylist_t ipkl;
                        dns_ipkeylist_init(&ipkl);
 
-                       CHECK(named_config_getipandkeylist(config, "primaries",
-                                                          obj, mctx, &ipkl));
+                       CHECK(named_config_getipandkeylist(config, obj, mctx,
+                                                          &ipkl));
                        dns_zone_setprimaries(mayberaw, ipkl.addrs,
                                              ipkl.sources, ipkl.keys,
                                              ipkl.tlss, ipkl.count);
index ba7476be93222da3e08ab254ba3797df6ea8de8e..e05ce211f24d75c466e648b49230c8da5145fe1a 100644 (file)
@@ -34,6 +34,6 @@ zone "." {
        file "redirect.db";
 };
 
-primaries "test" {
+remote-servers "test" {
        10.53.0.99;
 };
diff --git a/bin/tests/system/checkconf/bad-duplicate-primaries-2.conf b/bin/tests/system/checkconf/bad-duplicate-primaries-2.conf
deleted file mode 100644 (file)
index 1d1c6f0..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
- *
- * SPDX-License-Identifier: MPL-2.0
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, you can obtain one at https://mozilla.org/MPL/2.0/.
- *
- * See the COPYRIGHT file distributed with this work for additional
- * information regarding copyright ownership.
- */
-
-masters duplicate { 1.2.3.4; };
-primaries duplicate { 4.3.2.1; };
similarity index 84%
rename from bin/tests/system/checkconf/bad-duplicate-primaries-1.conf
rename to bin/tests/system/checkconf/bad-duplicate-remote-servers.conf
index 3bbabded18f34812fe7536920c221c13c3af73ac..dc35ee96c0fc63ee4cd6cf435921440120386328 100644 (file)
@@ -11,5 +11,5 @@
  * information regarding copyright ownership.
  */
 
-primaries duplicate { 1.2.3.4; };
-primaries duplicate { 4.3.2.1; };
+remote-servers duplicate { 1.2.3.4; };
+remote-servers duplicate { 4.3.2.1; };
index aa65a4d2aac3e33848a86b539f14ceb98df7cec8..c0312a539c28e0b72321b3a9d06626fcb2c4dc26 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 view "test" {
-       parental-agents "net" {
+       remote-servers "net" {
                192.168.1.2;
         };
        zone "example.net" {
index 7ca88f73e2c031248fb4c4fdb024844ca113f5f2..c5e1f1268bb65602fe34ea85ed86654c763d6481 100644 (file)
  * information regarding copyright ownership.
  */
 
-parental-agents "net" {
+remote-servers "net" {
        192.168.1.1;
 };
 
-parental-agents "net" {
+remote-servers "net" {
        192.168.1.2;
 };
 
index f61de06a624549f76efb8588f4c51b0c6dacd53f..0bd52a9082aeb8ff66a4af4f9e2beab0efca7c3b 100644 (file)
@@ -11,7 +11,7 @@
  * information regarding copyright ownership.
  */
 
-parental-agents "net" { };
+remote-servers "net" { };
 
 zone "example.net" {
        type primary;
index 98075c437b3b9f6649cf61c22eddda1ebf51aa2a..40fd75c2e07dfb8c21cc7af47b35d10e9751b68d 100644 (file)
@@ -11,7 +11,7 @@
  * information regarding copyright ownership.
  */
 
-parental-agents "com" {
+remote-servers "com" {
        192.168.1.2;
 };
 
index 464009824d79eb71261f2ae4a6ef3178324fd6b9..543d97c2657651a08dc822f15d69543758acd9d6 100644 (file)
@@ -11,7 +11,7 @@
  * information regarding copyright ownership.
  */
 
-primaries "net" {
+remote-servers "net" {
         192.168.1.2;
 };
 
similarity index 87%
rename from bin/tests/system/checkconf/good-masters-and-primaries.conf
rename to bin/tests/system/checkconf/good-multiple-remote-servers.conf
index d84657fce5273805a6f80dcf7f544ac24c00c808..f06c2bb2edd61889b7abd32bd056df6fd2f37b5d 100644 (file)
@@ -11,5 +11,5 @@
  * information regarding copyright ownership.
  */
 
-masters a { 1.2.3.4; };
-primaries b { 1.2.3.4; };
+remote-servers a { 1.2.3.4; };
+remote-servers b { 1.2.3.4; };
index 18b35c9efbf0cc11ba5667aa241aa6e5f24d3796..876b086787412ab65951e5d49567e80fcac6f6d3 100644 (file)
@@ -86,7 +86,7 @@ options {
        transfer-source 0.0.0.0;
        zone-statistics none;
 };
-parental-agents "parents" port 5353 source 10.10.10.10 source-v6 2001:db8::10 {
+remote-servers "parents" port 5353 source 10.10.10.10 source-v6 2001:db8::10 {
        10.10.10.11;
        2001:db8::11;
 };
index 4662e5a90013fc24b7642812e07be2aae2f2bc6a..34852914f442473942254c6d0f91197426577883 100644 (file)
@@ -12,8 +12,8 @@
  */
 
 acl "transferees" {};
-primaries "stealthPrimaries" {127.0.0.1;};
-primaries "publicSecondaries" {127.0.0.1;};
+remote-servers "stealthPrimaries" {127.0.0.1;};
+remote-servers "publicSecondaries" {127.0.0.1;};
 zone "example.net" {
        type secondary;
        key-directory "/var/lib/bind/example.net";
index 88c403c2db43748c962be3a4b6867fb923e61845..c290c93f5aa967b6fb48bc9abbe71879df42b9d8 100644 (file)
@@ -12,8 +12,8 @@
  */
 
 acl "transferees" {};
-primaries "stealthPrimaries" {127.0.0.1;};
-primaries "publicSecondaries" {127.0.0.1;};
+remote-servers "stealthPrimaries" {127.0.0.1;};
+remote-servers "publicSecondaries" {127.0.0.1;};
 zone "example.net" {
        type secondary;
        file "/var/cache/bind/example.net.db";
index af7c14130f8c96e30cfe24f856897465d460882b..44635e65c8e07d82f9504883dfeed0ef240ce9ff 100644 (file)
@@ -12,8 +12,8 @@
  */
 
 acl "transferees" {};
-primaries "stealthPrimaries" {127.0.0.1;};
-primaries "publicSecondaries" {127.0.0.1;};
+remote-servers "stealthPrimaries" {127.0.0.1;};
+remote-servers "publicSecondaries" {127.0.0.1;};
 zone "example.net" {
        type secondary;
        key-directory "/var/lib/bind/example.net";
index 0f2ec838e9f1e7e201aabbe76f6a9080c2376da0..34d3a499794df1995fcfdf65041b47f8206e4902 100644 (file)
@@ -37,7 +37,7 @@ controls {
        inet 10.53.0.9 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
 };
 
-parental-agents "ns8" port @PORT@ {
+remote-servers "ns8" port @PORT@ {
        10.53.0.8;
 };
 
index f655551c8c5e7263da6fc09003e4d27316bd5811..2c80fc3027dfd41de0ccd97bc746cf3ab950d86e 100644 (file)
@@ -51,10 +51,8 @@ zone "example" {
        also-notify { /* empty */ };
 };
 
-# use both 'primaries' and 'masters' to test that they
-# can work correctly together.
-primaries noport { 10.53.0.4; };
-masters x21 port @EXTRAPORT1@ { noport; };
+remote-servers noport { 10.53.0.4; };
+remote-servers x21 port @EXTRAPORT1@ { noport; };
 
 zone x1 {
        type primary;
index 56d95f5c1fbe61c0a9748f99f67bb1552e14be56..7b5194f70d2524b54bdb9abf5bd365ed5215078f 100644 (file)
@@ -94,7 +94,7 @@ zone "other.nil" {
        allow-transfer { any; };
 };
 
-primaries others {
+remote-servers others {
        10.53.0.2 port @PORT@;
        10.53.0.2 port @PORT@ key altkey;
 };
index 761e112893a663846984240d99a3bf9e79006111..2835715eea7face5835f4c0293ba237b97974f5b 100644 (file)
@@ -61,7 +61,7 @@ zone "tsigzone" {
        allow-transfer { tzkey; };
 };
 
-primaries "ns1" port @PORT@ source 10.53.0.2 {
+remote-servers "ns1" port @PORT@ source 10.53.0.2 {
        10.53.0.1;
 };
 
index 1679d3388fe0f99b4dd6e742de250cae87de19a5..7a843428235bbbcb73f77892caba8e6feb9d3d7b 100644 (file)
@@ -365,7 +365,7 @@ file documentation:
         A list of a :term:`port` or a port range. A port range is specified in the form of ``range`` followed by two :term:`port` s, ``port_low`` and ``port_high``, which represents port numbers from ``port_low`` through ``port_high``, inclusive. ``port_low`` must not be larger than ``port_high``. For example, ``range 1024 65535`` represents ports from 1024 through 65535. The asterisk (``*``) character is not allowed as a valid :term:`port` or as a port range boundary.
 
     ``remote-servers``
-        A named list of one or more :term:`ip_address` es with optional :term:`tls_id`, :term:`server_key`, and/or :term:`port`. A ``remote-servers`` list may include other ``remote-servers`` lists. See :any:`primaries` block.
+        A named list of one or more :term:`ip_address` es with optional :term:`tls_id`, :term:`server_key`, and/or :term:`port`. A ``remote-servers`` list may include other ``remote-servers`` lists.
 
     ``server_key``
         A :term:`domain_name` representing the name of a shared key, to be used for
@@ -413,17 +413,11 @@ The following blocks are supported:
     :any:`logging`
         Specifies what information the server logs and where the log messages are sent.
 
-    ``masters``
-        Synonym for :any:`primaries`.
-
     :namedconf:ref:`options`
         Controls global server configuration options and sets defaults for other statements.
 
-    :any:`parental-agents`
-        Defines a named list of servers for inclusion in primary and secondary zones' :any:`parental-agents` lists.
-
-    :any:`primaries`
-        Defines a named list of servers for inclusion in stub and secondary zones' :any:`primaries` or :any:`also-notify` lists. (Note: this is a synonym for the original keyword ``masters``, which can still be used, but is no longer the preferred terminology.)
+    :namedconf:ref:`remote-servers`
+        Defines a named list of servers for inclusion in various zone statements such as :any:`parental-agents`, :any:`primaries` or :any:`also-notify` lists.
 
     :namedconf:ref:`server`
         Sets certain configuration options on a per-server basis.
@@ -1048,34 +1042,20 @@ At ``debug`` level 4 or higher, the detailed context information logged at
 ``debug`` level 2 is logged for errors other than SERVFAIL and for negative
 responses such as NXDOMAIN.
 
-:any:`parental-agents` Block Grammar
+``remote-servers`` Block Grammar
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. namedconf:statement:: parental-agents
-   :tags: zone
-   :short: Defines a list of delegation agents to be used by primary and secondary zones.
-
-:any:`parental-agents` Block Definition and Usage
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-:any:`parental-agents` lists allow for a common set of parental agents to be
-easily used by multiple primary and secondary zones. A "parental agent" is a
-trusted DNS server that is queried to check whether DS records for a given zones
-are up-to-date.
+.. namedconf:statement:: remote-servers
+   :tags: server
+   :short: Defines a list of servers to be used by primary and secondary zones.
 
-:any:`primaries` Block Grammar
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.. namedconf:statement:: primaries
-   :tags: zone
-   :short: Defines one or more primary servers for a zone.
+This specifies a list that allows for a common set of servers to be easily used
+by multiple zones. The following options may reference to a list of
+remote servers: :any:`parental-agents`, :any:`primaries`, and :any:`also-notify`.
 
-:any:`primaries` Block Definition and Usage
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+A "parental agent" is a trusted DNS server that is queried to check whether DS
+records for a given zones are up-to-date.
 
-:any:`primaries` lists allow for a common set of primary servers to be easily
-used by multiple stub and secondary zones in their :any:`primaries` or
-:any:`also-notify` lists. (Note: :any:`primaries` is a synonym for the original
-keyword ``masters``, which can still be used, but is no longer the
-preferred terminology.)
+A "primary server" is where a secondary server can request zone transfers from.
 
 To force the zone transfer requests to be sent over TLS, use :any:`tls` keyword,
 e.g. ``primaries { 192.0.2.1 tls tls-configuration-name; };``,
@@ -3388,6 +3368,19 @@ options apply to zone transfers.
    per second. The lowest possible rate is one per second; when set to
    zero, it is silently raised to one.
 
+.. namedconf:statement:: primaries
+   :tags: transfer, zone
+   :short: Defines one or more servers that zone transfer can be requested from.
+
+   This specifies a list of one or more IP addresses of primary servers that
+   the secondary contacts to update its copy of the zone. Primaries list
+   elements can also be names of :any:`remote-servers` blocks.
+
+   By default, transfers are made from port 53 on the servers; this can be
+   changed for all servers by specifying a port number before the list of IP
+   addresses, or on a per-server basis after the IP address. Authentication to
+   the primary can also be done with per-server TSIG keys.
+
 .. namedconf:statement:: startup-notify-rate
    :tags: transfer, zone
    :short: Specifies the rate at which NOTIFY requests are sent when the name server is first starting, or when new zones have been added.
@@ -6476,6 +6469,18 @@ old DNSSEC key.
       trust relationship with the parental agent. For example, use TSIG to
       authenticate the parental agent, or point to a validating resolver.
 
+.. namedconf:statement:: parental-agents
+   :tags: dnssec
+
+   This specifies a list of one or more IP addresses of parental agents that
+   are used to query the zone's DS records during a KSK rollover. The list of
+   parental agents can also contain the names of :any:`remote-servers` blocks.
+
+   By default, DS queries are sent from port 53 on the servers; this can be
+   changed for all servers by specifying a port number before the list of IP
+   addresses, or on a per-server basis after the IP address. Authentication to
+   the primary can also be done with per-server TSIG keys.
+
 The following options apply to DS queries sent to :any:`parental-agents`:
 
 .. namedconf:statement:: checkds
@@ -6662,33 +6667,22 @@ Zone Types
    :tags: zone
    :short: Contains a duplicate of the data for a zone that has been transferred from a primary server.
 
-    A secondary zone is a replica of a primary zone. Type ``slave`` is a
-    synonym for :any:`secondary <type secondary>`. The :any:`primaries` list specifies one or more IP
-    addresses of primary servers that the secondary contacts to update
-    its copy of the zone. Primaries list elements can
-    also be names of other primaries lists. By default,
-    transfers are made from port 53 on the servers;
-    this can be changed for all servers by specifying
-    a port number before the list of IP addresses,
-    or on a per-server basis after the IP address.
-    Authentication to the primary can also be done with
-    per-server TSIG keys.  If a file is specified, then the
-    replica is written to this file
-    whenever the zone
-    is changed, and reloaded from this file on a server
-    restart. Use of a file is recommended, since it
-    often speeds server startup and eliminates a
-    needless waste of bandwidth. Note that for large
-    numbers (in the tens or hundreds of thousands) of
-    zones per server, it is best to use a two-level
-    naming scheme for zone filenames. For example,
-    a secondary server for the zone
-    ``example.com`` might place
-    the zone contents into a file called
-    ``ex/example.com``, where
-    ``ex/`` is just the first two
-    letters of the zone name. (Most operating systems
-    behave very slowly if there are 100,000 files in a single directory.)
+   A secondary zone is a replica of a primary zone. Type ``slave`` is a
+   synonym for :any:`secondary <type secondary>`. The :any:`primaries` list
+   specifies one or more IP addresses of primary servers that the secondary
+   contacts to update its copy of the zone.
+
+   If a file is
+   specified, then the replica is written to this file whenever the zone
+   is changed, and reloaded from this file on a server restart. Use of a file
+   is recommended, since it often speeds server startup and eliminates a
+   needless waste of bandwidth. Note that for large numbers (in the tens or
+   hundreds of thousands) of zones per server, it is best to use a two-level
+   naming scheme for zone filenames. For example, a secondary server for the
+   zone ``example.com`` might place the zone contents into a file called
+   ``ex/example.com``, where ``ex/`` is just the first two letters of the zone
+   name. (Most operating systems behave very slowly if there are 100,000 files
+   in a single directory.)
 
 .. namedconf:statement:: type mirror
    :tags: zone
@@ -7056,6 +7050,15 @@ Zone Options
 :any:`notify-to-soa`
    See the description of :any:`notify-to-soa` in :ref:`boolean_options`.
 
+:any:`parental-agents`
+   This option is only meaningful if the zone is DNSSEC signed. When performing
+   a key rollover, BIND will query the parental agents to see if the new DS is
+   actually published before withdrawing the old DNSSEC key.
+
+:any:`primaries`
+   For secondary zones, these are the name servers to request zone transfers
+   from.
+
 :any:`zone-statistics`
    See the description of :any:`zone-statistics` in :namedconf:ref:`options`.
 
index 9a2501eea3931edf1e3332a0c84ca9fe8ce80ce2..eee428172fcbfd1a6cdd9a45782ec068c1254b60 100644 (file)
@@ -898,7 +898,7 @@ presence. Let's look at the following configuration excerpt:
 
 ::
 
-   parental-agents "net" {
+   remote-servers "net" {
        10.53.0.11; 10.53.0.12;
    };
 
index 4c253ed2866e1a789362cd4d8b9a0843ce37eacd..7d8099235653f90d287ba9ec0cea23c52a1dd06e 100644 (file)
@@ -319,11 +319,9 @@ options {
        zone-statistics ( full | terse | none | <boolean> );
 };
 
-parental-agents <string> [ port <integer> ] [ source ( <ipv4_address> | * ) ] [ source-v6 ( <ipv6_address> | * ) ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ] [ tls <string> ]; ... }; // may occur multiple times
-
 plugin ( query ) <string> [ { <unspecified-text> } ]; // may occur multiple times
 
-primaries <string> [ port <integer> ] [ source ( <ipv4_address> | * ) ] [ source-v6 ( <ipv6_address> | * ) ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ] [ tls <string> ]; ... }; // may occur multiple times
+remote-servers <string> [ port <integer> ] [ source ( <ipv4_address> | * ) ] [ source-v6 ( <ipv6_address> | * ) ] { ( <remote-servers> | <ipv4_address> [ port <integer> ] | <ipv6_address> [ port <integer> ] ) [ key <string> ] [ tls <string> ]; ... }; // may occur multiple times
 
 server <netprefix> {
        bogus <boolean>;
index ee4dfbfb94ad738f78f15f77cd5061f5675c2fd1..4406d044232e1079a02077f93b201904c744afb9 100644 (file)
@@ -2098,10 +2098,10 @@ check_remoteserverlist(const cfg_obj_t *cctx, const char *list,
 }
 
 /*
- * Check primaries lists for duplicates.
+ * Check remote-server lists for duplicates.
  */
 static isc_result_t
-check_primarylists(const cfg_obj_t *cctx, isc_mem_t *mctx) {
+check_remoteserverlists(const cfg_obj_t *cctx, isc_mem_t *mctx) {
        isc_result_t result, tresult;
        isc_symtab_t *symtab = NULL;
 
@@ -2109,31 +2109,7 @@ check_primarylists(const cfg_obj_t *cctx, isc_mem_t *mctx) {
        if (result != ISC_R_SUCCESS) {
                return result;
        }
-       tresult = check_remoteserverlist(cctx, "primaries", symtab, mctx);
-       if (tresult != ISC_R_SUCCESS) {
-               result = tresult;
-       }
-       tresult = check_remoteserverlist(cctx, "masters", symtab, mctx);
-       if (tresult != ISC_R_SUCCESS) {
-               result = tresult;
-       }
-       isc_symtab_destroy(&symtab);
-       return result;
-}
-
-/*
- * Check parental-agents lists for duplicates.
- */
-static isc_result_t
-check_parentalagentlists(const cfg_obj_t *cctx, isc_mem_t *mctx) {
-       isc_result_t result, tresult;
-       isc_symtab_t *symtab = NULL;
-
-       result = isc_symtab_create(mctx, 100, freekey, mctx, false, &symtab);
-       if (result != ISC_R_SUCCESS) {
-               return result;
-       }
-       tresult = check_remoteserverlist(cctx, "parental-agents", symtab, mctx);
+       tresult = check_remoteserverlist(cctx, "remote-servers", symtab, mctx);
        if (tresult != ISC_R_SUCCESS) {
                result = tresult;
        }
@@ -2405,8 +2381,8 @@ check_tls_definitions(const cfg_obj_t *config, isc_mem_t *mctx) {
 }
 
 static isc_result_t
-get_remotes(const cfg_obj_t *cctx, const char *list, const char *name,
-           const cfg_obj_t **ret) {
+get_remoteservers_def(const char *list, const char *name, const cfg_obj_t *cctx,
+                     const cfg_obj_t **ret) {
        isc_result_t result;
        const cfg_obj_t *obj = NULL;
        const cfg_listelt_t *elt = NULL;
@@ -2435,24 +2411,8 @@ get_remotes(const cfg_obj_t *cctx, const char *list, const char *name,
 }
 
 static isc_result_t
-get_remoteservers_def(const char *list, const char *name, const cfg_obj_t *cctx,
-                     const cfg_obj_t **ret) {
-       isc_result_t result = ISC_R_NOTFOUND;
-
-       if (strcmp(list, "primaries") == 0) {
-               result = get_remotes(cctx, "primaries", name, ret);
-               if (result != ISC_R_SUCCESS) {
-                       result = get_remotes(cctx, "masters", name, ret);
-               }
-       } else if (strcmp(list, "parental-agents") == 0) {
-               result = get_remotes(cctx, "parental-agents", name, ret);
-       }
-       return result;
-}
-
-static isc_result_t
-validate_remotes(const char *list, const cfg_obj_t *obj,
-                const cfg_obj_t *config, uint32_t *countp, isc_mem_t *mctx) {
+validate_remotes(const cfg_obj_t *obj, const cfg_obj_t *config,
+                uint32_t *countp, isc_mem_t *mctx) {
        isc_result_t result = ISC_R_SUCCESS;
        isc_result_t tresult;
        uint32_t count = 0;
@@ -2555,13 +2515,14 @@ resume:
                if (tresult == ISC_R_EXISTS) {
                        continue;
                }
-               tresult = get_remoteservers_def(list, listname, config, &obj);
+               tresult = get_remoteservers_def("remote-servers", listname,
+                                               config, &obj);
                if (tresult != ISC_R_SUCCESS) {
                        if (result == ISC_R_SUCCESS) {
                                result = tresult;
                        }
                        cfg_obj_log(addr, ISC_LOG_ERROR,
-                                   "unable to find %s list '%s'", list,
+                                   "unable to find remote-servers list '%s'",
                                    listname);
                        continue;
                }
@@ -3444,8 +3405,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
                }
                if (tresult == ISC_R_SUCCESS && donotify) {
                        uint32_t count;
-                       tresult = validate_remotes("primaries", obj, config,
-                                                  &count, mctx);
+                       tresult = validate_remotes(obj, config, &count, mctx);
                        if (tresult != ISC_R_SUCCESS && result == ISC_R_SUCCESS)
                        {
                                result = tresult;
@@ -3487,8 +3447,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
                        result = ISC_R_FAILURE;
                } else {
                        uint32_t count;
-                       tresult = validate_remotes("primaries", obj, config,
-                                                  &count, mctx);
+                       tresult = validate_remotes(obj, config, &count, mctx);
                        if (tresult != ISC_R_SUCCESS && result == ISC_R_SUCCESS)
                        {
                                result = tresult;
@@ -3512,8 +3471,7 @@ check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
                (void)cfg_map_get(zoptions, "parental-agents", &obj);
                if (obj != NULL) {
                        uint32_t count;
-                       tresult = validate_remotes("parental-agents", obj,
-                                                  config, &count, mctx);
+                       tresult = validate_remotes(obj, config, &count, mctx);
                        if (tresult != ISC_R_SUCCESS && result == ISC_R_SUCCESS)
                        {
                                result = tresult;
@@ -5911,11 +5869,7 @@ isccfg_check_namedconf(const cfg_obj_t *config, unsigned int flags,
                result = ISC_R_FAILURE;
        }
 
-       if (check_primarylists(config, mctx) != ISC_R_SUCCESS) {
-               result = ISC_R_FAILURE;
-       }
-
-       if (check_parentalagentlists(config, mctx) != ISC_R_SUCCESS) {
+       if (check_remoteserverlists(config, mctx) != ISC_R_SUCCESS) {
                result = ISC_R_FAILURE;
        }
 
index 24dd3596ee7f56c6351065f60020a99696a7e703..ecadfabb28045205e487d05ca3ddb2dcf4b6c160 100644 (file)
@@ -1143,8 +1143,7 @@ static cfg_clausedef_t namedconf_clauses[] = {
        { "masters", &cfg_type_remoteservers,
          CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_NODOC },
        { "options", &cfg_type_options, 0 },
-       { "parental-agents", &cfg_type_remoteservers, CFG_CLAUSEFLAG_MULTI },
-       { "primaries", &cfg_type_remoteservers, CFG_CLAUSEFLAG_MULTI },
+       { "remote-servers", &cfg_type_remoteservers, CFG_CLAUSEFLAG_MULTI },
 #if defined(HAVE_LIBXML2) || defined(HAVE_JSON_C)
        { "statistics-channels", &cfg_type_statschannels,
          CFG_CLAUSEFLAG_MULTI | CFG_CLAUSEFLAG_OPTIONAL },