]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove "mode" parameter from synthrecord
authorEvan Hunt <each@isc.org>
Sat, 27 Sep 2025 04:42:04 +0000 (21:42 -0700)
committerColin Vidal <colin@isc.org>
Wed, 1 Oct 2025 10:16:05 +0000 (12:16 +0200)
the plugin's operating mode is now determined automatically
from the zone name: if the name ends in "ip6.arpa" or "in-addr.arpa",
then the plugin is in reverse mode, otherwise forward.

24 files changed:
bin/plugins/synthrecord.c
bin/plugins/synthrecord.rst
bin/tests/system/synthrecord/conf/bad-forward-missing-origin.conf.j2
bin/tests/system/synthrecord/conf/bad-lib-path.conf.j2
bin/tests/system/synthrecord/conf/bad-multi-label-prefix.conf.j2
bin/tests/system/synthrecord/conf/bad-neg-ttl.conf.j2
bin/tests/system/synthrecord/conf/bad-no-mode.conf.j2 [deleted file]
bin/tests/system/synthrecord/conf/bad-no-origin.conf.j2
bin/tests/system/synthrecord/conf/bad-no-prefix.conf.j2
bin/tests/system/synthrecord/conf/bad-origin-name.conf.j2
bin/tests/system/synthrecord/conf/bad-origin-no-absolute.conf.j2
bin/tests/system/synthrecord/conf/bad-origin-type.conf.j2
bin/tests/system/synthrecord/conf/bad-prefix-type.conf.j2
bin/tests/system/synthrecord/conf/bad-tsig.conf.j2
bin/tests/system/synthrecord/conf/bad-unknown-mode.conf.j2 [deleted file]
bin/tests/system/synthrecord/conf/bad-wrong-mode.conf.j2 [deleted file]
bin/tests/system/synthrecord/conf/bad-wrong-ttl-type.conf.j2
bin/tests/system/synthrecord/conf/good-no-allow-synth.conf.j2
bin/tests/system/synthrecord/conf/good-no-ttl.conf.j2
bin/tests/system/synthrecord/conf/good1.conf.j2
bin/tests/system/synthrecord/conf/good2.conf.j2 [deleted file]
bin/tests/system/synthrecord/conf/good3.conf.j2 [deleted file]
bin/tests/system/synthrecord/ns1/named.conf.j2
bin/tests/system/synthrecord/tests_synthrecord.py

index a42b4475811fa5924fae2aec27f1a108d781ad42..06200381bc73a6c7e1a94f9e524090ce775235ad 100644 (file)
@@ -401,8 +401,7 @@ static cfg_clausedef_t synthrecord_cfgclauses[] = {
        { "prefix", &cfg_type_astring, 0 },
        { "origin", &cfg_type_astring, 0 },
        { "allow-synth", &cfg_type_bracketed_aml, 0 },
-       { "ttl", &cfg_type_uint32, 0 },
-       { "mode", &cfg_type_ustring, 0 }
+       { "ttl", &cfg_type_uint32, 0 }
 };
 
 static cfg_clausedef_t *synthrecord_cfgparamsclausesets[] = {
@@ -482,36 +481,15 @@ synthrecord_initorigin(synthrecord_t *inst, const cfg_obj_t *synthrecordcfg) {
        return result;
 }
 
-static isc_result_t
-synthrecord_parseconfigmode(synthrecord_t *inst,
-                           const cfg_obj_t *synthrecordcfg) {
-       isc_result_t result;
-       const cfg_obj_t *obj = NULL;
-       const char *modestr = NULL;
-
-       result = cfg_map_get(synthrecordcfg, "mode", &obj);
-       if (result != ISC_R_SUCCESS) {
-               isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS,
-                             ISC_LOG_ERROR,
-                             "synthrecord: missing mode (forward or reverse)");
-               return result;
-       }
-
-       modestr = obj->value.string.base;
-       if (strcasecmp("forward", modestr) == 0) {
-               inst->mode = FORWARD;
-       } else if (strcasecmp("reverse", modestr) == 0) {
+static void
+synthrecord_setconfigmode(synthrecord_t *inst, const dns_name_t *zname) {
+       if (dns_name_issubdomain(zname, dns_ip6arpa) ||
+           dns_name_issubdomain(zname, dns_inaddrarpa))
+       {
                inst->mode = REVERSE;
        } else {
-               isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS,
-                             ISC_LOG_ERROR,
-                             "synthrecord: mode %s is not allowed (forward or "
-                             "reverse only)",
-                             modestr);
-               result = ISC_R_NOTFOUND;
+               inst->mode = FORWARD;
        }
-
-       return result;
 }
 
 static isc_result_t
@@ -576,7 +554,8 @@ synthrecord_parsettl(synthrecord_t *inst, const cfg_obj_t *synthrecordcfg) {
 static isc_result_t
 synthrecord_parseconfig(synthrecord_t *inst, const char *parameters,
                        const cfg_obj_t *cfg, const char *cfgfile,
-                       unsigned long cfgline, cfg_aclconfctx_t *aclctx) {
+                       unsigned long cfgline, cfg_aclconfctx_t *aclctx,
+                       const dns_name_t *zname) {
        isc_result_t result;
        isc_mem_t *mctx = inst->mctx;
        cfg_parser_t *parser = NULL;
@@ -591,7 +570,7 @@ synthrecord_parseconfig(synthrecord_t *inst, const char *parameters,
        CHECK(cfg_parse_buffer(parser, &b, cfgfile, cfgline,
                               &synthrecord_cfgparams, 0, &synthrecordcfg));
 
-       CHECK(synthrecord_parseconfigmode(inst, synthrecordcfg));
+       synthrecord_setconfigmode(inst, zname);
        CHECK(synthrecord_initorigin(inst, synthrecordcfg));
        CHECK(synthrecord_initprefix(inst, synthrecordcfg));
        CHECK(synthrecord_parseallowsynth(inst, cfg, aclctx, synthrecordcfg));
@@ -624,14 +603,6 @@ plugin_register(const char *parameters, const void *cfg, const char *cfgfile,
        REQUIRE(hooktable);
        REQUIRE(instp && *instp == NULL);
 
-       if (ctx->source != NS_HOOKSOURCE_ZONE) {
-               isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS,
-                             ISC_LOG_INFO,
-                             "registering 'synthrecord' failed as it was not "
-                             "configured as a zone plugin");
-               return ISC_R_FAILURE;
-       }
-
        isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
                      "registering 'synthrecord' module from %s:%lu", cfgfile,
                      cfgline);
@@ -643,7 +614,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfgfile,
        isc_mem_attach(mctx, &inst->mctx);
        result = ISC_R_SUCCESS;
        result = synthrecord_parseconfig(inst, parameters, cfg, cfgfile,
-                                        cfgline, actx);
+                                        cfgline, actx, ctx->origin);
 
        hook = (ns_hook_t){ .action = synthrecord_entry, .action_data = inst };
        ns_hook_add(hooktable, mctx, NS_QUERY_NXDOMAIN_BEGIN, &hook);
@@ -660,16 +631,25 @@ plugin_register(const char *parameters, const void *cfg, const char *cfgfile,
 isc_result_t
 plugin_check(const char *parameters, const void *cfg, const char *cfgfile,
             unsigned long cfgline, isc_mem_t *mctx, void *actx,
-            const ns_pluginregister_ctx_t *ctx ISC_ATTR_UNUSED) {
+            const ns_pluginregister_ctx_t *ctx) {
        isc_result_t result;
-       synthrecord_t *inst;
+       synthrecord_t *inst = NULL;
+       const dns_name_t *zname = (ctx == NULL) ? NULL : ctx->origin;
+
+       if (ctx->source != NS_HOOKSOURCE_ZONE || ctx->origin == NULL) {
+               isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS,
+                             ISC_LOG_INFO,
+                             "'synthrecord' must be configured "
+                             "as a zone plugin");
+               return ISC_R_FAILURE;
+       }
 
        inst = isc_mem_get(mctx, sizeof(*inst));
        *inst = (synthrecord_t){};
 
        isc_mem_attach(mctx, &inst->mctx);
        result = synthrecord_parseconfig(inst, parameters, cfg, cfgfile,
-                                        cfgline, actx);
+                                        cfgline, actx, zname);
        plugin_destroy((void **)&inst);
 
        return result;
index 0d6d8a3eab6e9e84d8812af144711c73d4f1ffbd..044bd2d93d2b1e33a8f3a193003a00ea02491049 100644 (file)
@@ -29,9 +29,13 @@ Description
 enabling :iscman:`named` to synthesize forward and reverse responses for
 non-existent names in a zone.
 
-This plugin can only configured inside a ``zone`` clause.
+This plugin can only configured inside a ``zone`` clause. The name
+of the zone affects the mode in which the plugin operates:  if
+the zone name ends with "ip6.arpa" or "in-addr.arpa", then the plugin
+operates in "reverse" mode, and for any other zone name, it operates
+in "forward" mode.
 
-In ``reverse`` mode, the module intercepts queries of type PTR. If no
+In "reverse" mode, the module intercepts queries of type PTR. If no
 authoritative answer can be found in the zone database, and if the IP
 address encoded in the query name matches one of the prefixes or addresses
 specified in ``allow-synth``, then the module dynamically generates a
@@ -39,13 +43,13 @@ response, constructed by concatenating the configured ``prefix``, the IP
 address encoded in the query reverse name, and the configured ``origin``.
 
 In ``forward`` mode, the module intercepts queries of type A or AAAA.
-If no authoritative answer can be found in the zone, the query
+If no authoritative answer can be found in the zone, and the query
 begins and ends with the configured ``prefix`` and ``origin``, and an
 IP address can be parsed from the part in between, then that IP address
-is returned to the client.
+will be returned to the client.
 
-Note: these synthesized responses are not signed, so the use of this
-module is incompatible with DNSSEC.
+Note: Synthesized responses are not signed, so the use of this module
+is incompatible with DNSSEC.
 
 Example
 ~~~~~~~
@@ -56,7 +60,6 @@ Example
        type primary;
        file "1.168.192.in-addr.arpa.db";
        plugin query "synthrecord" {
-           mode reverse;
            prefix "dynamic-";
            origin "example.";
        };
@@ -66,7 +69,6 @@ Example
        type primary;
        file "e.f.a.c.ip6.arpa.db";
        plugin query "synthrecord" {
-           mode reverse;
            prefix "dynamic-";
            origin "example.";
        };
@@ -76,7 +78,6 @@ Example
        type primary;
        file "example.db";
        plugin query "synthrecord" {
-           mode forward;
            prefix "dynamic-";
            origin "example.";
            allow-synth { 192.168.1/24; cafe::/16; };
@@ -109,11 +110,6 @@ Parameters
 
 The following parameters are mandatory:
 
-``mode``
-   If ``reverse``, the module will synthesize responses when answering PTR
-   queries. If ``forward``, it will synthesize responses when answering
-   A/AAAA queries.
-
 ``prefix``
    Specifies the prefix of the synthesized name. It must be a single-label
    name.
index 685a843baea72bb848c0ca288aa86ab44bf7b5e8..e21139dd5741d8ef6839d82634e65ea04641f9c8 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone example {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix "dynamic-";
+               allow-synth {
+                       10.53.0.0/16;
+                       192.168.1.0/24;
+                       192.180.0.0/18;
+                       cafe:cafe::/32;
+               };
+               ttl 60;
        };
-       ttl 60;
-       mode forward;
 };
index e216496f15fad66cdaf9a367ca8f398517b062b9..cfd53db13b72052299561b669668e0d231a7a741 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "../../../plugins/.libs/synthrecordwrong.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone 192.in-addr.arpa {
+       type primary;
+       file "file";
+       plugin query "../../../plugins/.libs/synthrecordwrong.so" {
+               prefix "dynamic-";
+               allow-synth {
+                       192.168.1.0/24;
+                       192.180.0.0/18;
+               };
+               origin example.;
+               ttl 60;
        };
-       origin example.;
-       ttl 60;
-       mode reverse;
 };
index 6ee9ce2c9480c759cdd397a22fd11d3b3fa43f7d..b064813b59f3cc8781b37ef101d595c6bed739a4 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynam.ic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone 192.in-addr.arpa {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix "dynam.ic-";
+               allow-synth {
+                       192.168.1.0/24;
+                       192.180.0.0/18;
+               };
+               origin example.;
+               ttl 60;
        };
-       origin example.;
-       ttl 60;
-       mode reverse;
 };
index 6756d0643c7884a494191a9bfcfc4c61e5a004a6..177cee5708d67a2d68872f85f7da2f30973261a8 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone 192.in-addr.arpa {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix "dynamic-";
+               allow-synth {
+                       192.168.1.0/24;
+                       192.180.0.0/18;
+               };
+               origin example.;
+               ttl -60;
        };
-       origin example.;
-       ttl -60;
-       mode reverse;
 };
diff --git a/bin/tests/system/synthrecord/conf/bad-no-mode.conf.j2 b/bin/tests/system/synthrecord/conf/bad-no-mode.conf.j2
deleted file mode 100644 (file)
index 2e9157d..0000000
+++ /dev/null
@@ -1,24 +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.
- */
-
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
-       };
-       origin example.;
-       ttl 60;
-};
index d8225d90144352a5e3bbdccdb62f547409bf5239..153cf93acfa1de8f8ecbb1c21850ebadc9065796 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix dynamic-;
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone 10.in-addr.arpa {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix dynamic-;
+               allow-synth {
+                       10.53.0.0/16;
+               };
+               ttl 60;
        };
-       ttl 60;
-       mode reverse;
 };
index 63ca41339c685c8699f7d484646c44dd41ad8641..2e2e6a28c5337831c3e28fabdd4462aa8971252e 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone 10.in-addr.arpa {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               allow-synth {
+                       10.53.0.0/16;
+               };
+               origin "example.";
+               ttl 60;
        };
-       origin "example.";
-       ttl 60;
-       mode reverse;
 };
index 47392f5b5145b71fd854b40f4fb9e7e0f7cd94e2..4f450d8a9e419b9b8576f5a531795370c81e05b7 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix dynamic-;
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone 10.in-addr.arpa {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix dynamic-;
+               origin _e/x'ample.;
+               ttl 60;
        };
-       origin _e/x'ample.;
-       ttl 60;
-       mode reverse;
 };
index a22ff911fc89c46db65f8af92dcda4eda4ed2bb4..c07d4e15d4920ac55d259056465301ba15d27f51 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix dynamic-;
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone 192.in-addr.arpa {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix dynamic-;
+               origin "example";
+               ttl 60;
        };
-       origin "example";
-       ttl 60;
-       mode reverse;
 };
index a89a0e721a22a0ea1547212e1ca8a553eeb901dc..730b9d2b092c960e29b7bcb8ed51d9ad93838d3e 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix dynamic-;
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone example {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix dynamic-;
+               origin { 10.0.0.1/24; };
+               ttl 60;
        };
-       origin { 10.0.0.1/24; };
-       ttl 60;
-       mode reverse;
 };
index d3047ed979181ea9e0b5da7845144d308854708c..6090073cf4bb1fe8e03d6a375a9689ff6882e9f4 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix { 10.43.4.5/2; };
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone example {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix { 10.43.4.5/2; };
+               origin "example.";
+               ttl 60;
        };
-       origin "example.";
-       ttl 60;
-       mode reverse;
 };
index be5575ac9a7c7bbbe3f48516933c196042596996..e870a2d270c85fb336ae548073abb1cfdd40e55b 100644 (file)
@@ -16,13 +16,16 @@ key "test-tsig." {
     secret "DAopyf1mhCbFVZw7pgmNPBoLUq8wEUT7UuPoLENP2HY=";
 };
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               192.168.1.5;
-               key test-tsig.;
+zone example {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix "dynamic-";
+               allow-synth {
+                       192.168.1.5;
+                       key test-tsig.;
+               };
+               origin example.;
+               ttl 50;
        };
-       origin example.;
-       ttl 50;
-       mode reverse;
 };
diff --git a/bin/tests/system/synthrecord/conf/bad-unknown-mode.conf.j2 b/bin/tests/system/synthrecord/conf/bad-unknown-mode.conf.j2
deleted file mode 100644 (file)
index d09e3e0..0000000
+++ /dev/null
@@ -1,25 +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.
- */
-
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
-       };
-       origin example.;
-       ttl 60;
-       mode foobar;
-};
diff --git a/bin/tests/system/synthrecord/conf/bad-wrong-mode.conf.j2 b/bin/tests/system/synthrecord/conf/bad-wrong-mode.conf.j2
deleted file mode 100644 (file)
index 901506d..0000000
+++ /dev/null
@@ -1,25 +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.
- */
-
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
-       };
-       origin example.;
-       ttl 60;
-       mode 123;
-};
index 77021e65b17ae8c4c6f20ec7fd341dc49b6a74eb..db8014c9b9870a0e4426abbc2f638d46442771a1 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone 10.in-addr.arpa {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix "dynamic-";
+               allow-synth {
+                       192.168.1.0/24;
+                       192.180.0.0/18;
+               };
+               origin example.;
+               ttl "foobar";
        };
-       origin example.;
-       ttl "foobar";
-       mode reverse;
 };
index 990891041fcb16fdd7bb177a7fac850aba47950a..a8ef05301604b67b61030fbbced0fbe6ffcdd144 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix dynamic-;
-       origin "example.";
-       ttl 60;
-       mode reverse;
+zone 10.in-addr.arpa {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix dynamic-;
+               origin "example.";
+               ttl 60;
+       };
 };
index 8f63b55ed555c2dd4accacb4dac86cc207e13f9e..4d05862fe540ee536f9c7241ae125c5f8552feab 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
+zone example {
+       type primary;
+       file "file";
+       plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+               prefix "dynamic-";
+               allow-synth {
+                       10.53.0.0/16;
+               };
+               origin example.;
        };
-       origin example.;
-       mode reverse;
 };
index 6ff0739f63c105fe4ae4f909cb1ef75e05b93256..120b79b74dffcd341e8c3b5216d7a5d98ab39ba0 100644 (file)
  * information regarding copyright ownership.
  */
 
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
-       };
-       origin example.;
-       ttl 60;
-       mode reverse;
+zone 10.in-addr.arpa {
+       type primary;
+       file "10.in-addr.arpa.db";
+        plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+                prefix "dynamic-";
+                allow-synth {
+                        10.53.0.0/16;
+                };
+                origin example.;
+                ttl 60;
+        };
+};
+
+zone e.f.a.c.ip6.arpa {
+       type primary;
+       file "e.f.a.c.in-addr.arpa.db";
+        plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+                prefix "dynamic-";
+                allow-synth {
+                        cafe:cafe::/32;
+                };
+                origin example.;
+                ttl 60;
+        };
+};
+
+zone example {
+       type primary;
+       file "example.db";
+        plugin query "@TOP_BUILDDIR@/synthrecord.so" {
+                prefix "dynamic-";
+                allow-synth {
+                        10.53.0.0/16;
+                        cafe:cafe::/32;
+                };
+                origin example.;
+                ttl 60;
+        };
 };
diff --git a/bin/tests/system/synthrecord/conf/good2.conf.j2 b/bin/tests/system/synthrecord/conf/good2.conf.j2
deleted file mode 100644 (file)
index a0b176e..0000000
+++ /dev/null
@@ -1,25 +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.
- */
-
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix dynamic-;
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
-       };
-       origin "example.";
-       ttl 60;
-       mode reverse;
-};
diff --git a/bin/tests/system/synthrecord/conf/good3.conf.j2 b/bin/tests/system/synthrecord/conf/good3.conf.j2
deleted file mode 100644 (file)
index aa36d5b..0000000
+++ /dev/null
@@ -1,25 +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.
- */
-
-plugin query "@TOP_BUILDDIR@/synthrecord.so" {
-       prefix "dynamic-";
-       allow-synth {
-               10.53.0.0/16;
-               192.168.1.0/24;
-               192.180.0.0/18;
-               cafe:cafe::/32;
-       };
-       ttl 60;
-       mode forward;
-       origin example.;
-};
index a58dd8c1dff2b8b09049956224f494810bf2b73a..7e53d4bdde2307beb132b823be02584a01ee02d9 100644 (file)
@@ -43,7 +43,6 @@ plugin query "@TOP_BUILDDIR@/synthrecord" {
        };
        origin example.;
        ttl 3600;
-       mode reverse;
 };
 {% endif %}
 
@@ -62,7 +61,6 @@ zone "example" {
                };
                origin example.;
                ttl 3600;
-               mode forward;
        };
 };
 
@@ -76,7 +74,6 @@ zone "0.53.10.in-addr.arpa." {
                };
                origin example.;
                ttl 3600;
-               mode reverse;
        };
 };
 
@@ -90,7 +87,6 @@ zone "1.53.10.in-addr.arpa." {
                };
                origin example.;
                ttl 3600;
-               mode reverse;
        };
 };
 
@@ -109,7 +105,6 @@ zone "e.f.a.c.e.f.a.c.ip6.arpa." {
                };
                origin example.;
                ttl 3600;
-               mode reverse;
        };
 };
 
@@ -119,7 +114,6 @@ zone "f.f.f.f.ip6.arpa." {
        plugin query "@TOP_BUILDDIR@/synthrecord" {
                prefix "dynamicdefaults-";
                origin example.;
-               mode reverse;
        };
 };
 
@@ -133,7 +127,6 @@ zone "0.0.0.0.ip6.arpa." {
                };
                origin example.;
                ttl 3600;
-               mode reverse;
        };
 };
 
@@ -147,6 +140,5 @@ zone "168.192.in-addr.arpa." {
                };
                origin example.;
                ttl 3600;
-               mode reverse;
        };
 };
index ceeca8a1b69290cb20f3e6568053193548a3b836..7f453ee7ea8056528e9137ddf3c71ede064dc786 100644 (file)
@@ -493,6 +493,4 @@ def test_synthrecord_inview(ns1, templates):
         try:
             ns1.rndc("reconfig")
         except isctest.rndc.RNDCException:
-            watcher.wait_for_line(
-                "registering 'synthrecord' failed as it was not configured as a zone plugin"
-            )
+            watcher.wait_for_line("'synthrecord' must be configured as a zone plugin")