From: Evan Hunt Date: Sat, 27 Sep 2025 04:42:04 +0000 (-0700) Subject: remove "mode" parameter from synthrecord X-Git-Tag: v9.21.14~13^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4b5deb750fe627555d6400b6d1e954d8f026566;p=thirdparty%2Fbind9.git remove "mode" parameter from synthrecord 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. --- diff --git a/bin/plugins/synthrecord.c b/bin/plugins/synthrecord.c index a42b4475811..06200381bc7 100644 --- a/bin/plugins/synthrecord.c +++ b/bin/plugins/synthrecord.c @@ -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; diff --git a/bin/plugins/synthrecord.rst b/bin/plugins/synthrecord.rst index 0d6d8a3eab6..044bd2d93d2 100644 --- a/bin/plugins/synthrecord.rst +++ b/bin/plugins/synthrecord.rst @@ -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. diff --git a/bin/tests/system/synthrecord/conf/bad-forward-missing-origin.conf.j2 b/bin/tests/system/synthrecord/conf/bad-forward-missing-origin.conf.j2 index 685a843baea..e21139dd574 100644 --- a/bin/tests/system/synthrecord/conf/bad-forward-missing-origin.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-forward-missing-origin.conf.j2 @@ -11,14 +11,17 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/bad-lib-path.conf.j2 b/bin/tests/system/synthrecord/conf/bad-lib-path.conf.j2 index e216496f15f..cfd53db13b7 100644 --- a/bin/tests/system/synthrecord/conf/bad-lib-path.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-lib-path.conf.j2 @@ -11,15 +11,16 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/bad-multi-label-prefix.conf.j2 b/bin/tests/system/synthrecord/conf/bad-multi-label-prefix.conf.j2 index 6ee9ce2c948..b064813b59f 100644 --- a/bin/tests/system/synthrecord/conf/bad-multi-label-prefix.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-multi-label-prefix.conf.j2 @@ -11,15 +11,16 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/bad-neg-ttl.conf.j2 b/bin/tests/system/synthrecord/conf/bad-neg-ttl.conf.j2 index 6756d0643c7..177cee5708d 100644 --- a/bin/tests/system/synthrecord/conf/bad-neg-ttl.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-neg-ttl.conf.j2 @@ -11,15 +11,16 @@ * 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 index 2e9157d9af3..00000000000 --- a/bin/tests/system/synthrecord/conf/bad-no-mode.conf.j2 +++ /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; -}; diff --git a/bin/tests/system/synthrecord/conf/bad-no-origin.conf.j2 b/bin/tests/system/synthrecord/conf/bad-no-origin.conf.j2 index d8225d90144..153cf93acfa 100644 --- a/bin/tests/system/synthrecord/conf/bad-no-origin.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-no-origin.conf.j2 @@ -11,14 +11,14 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/bad-no-prefix.conf.j2 b/bin/tests/system/synthrecord/conf/bad-no-prefix.conf.j2 index 63ca41339c6..2e2e6a28c53 100644 --- a/bin/tests/system/synthrecord/conf/bad-no-prefix.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-no-prefix.conf.j2 @@ -11,14 +11,14 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/bad-origin-name.conf.j2 b/bin/tests/system/synthrecord/conf/bad-origin-name.conf.j2 index 47392f5b514..4f450d8a9e4 100644 --- a/bin/tests/system/synthrecord/conf/bad-origin-name.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-origin-name.conf.j2 @@ -11,15 +11,12 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/bad-origin-no-absolute.conf.j2 b/bin/tests/system/synthrecord/conf/bad-origin-no-absolute.conf.j2 index a22ff911fc8..c07d4e15d49 100644 --- a/bin/tests/system/synthrecord/conf/bad-origin-no-absolute.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-origin-no-absolute.conf.j2 @@ -11,15 +11,12 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/bad-origin-type.conf.j2 b/bin/tests/system/synthrecord/conf/bad-origin-type.conf.j2 index a89a0e721a2..730b9d2b092 100644 --- a/bin/tests/system/synthrecord/conf/bad-origin-type.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-origin-type.conf.j2 @@ -11,15 +11,12 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/bad-prefix-type.conf.j2 b/bin/tests/system/synthrecord/conf/bad-prefix-type.conf.j2 index d3047ed9791..6090073cf4b 100644 --- a/bin/tests/system/synthrecord/conf/bad-prefix-type.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-prefix-type.conf.j2 @@ -11,15 +11,12 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/bad-tsig.conf.j2 b/bin/tests/system/synthrecord/conf/bad-tsig.conf.j2 index be5575ac9a7..e870a2d270c 100644 --- a/bin/tests/system/synthrecord/conf/bad-tsig.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-tsig.conf.j2 @@ -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 index d09e3e0808b..00000000000 --- a/bin/tests/system/synthrecord/conf/bad-unknown-mode.conf.j2 +++ /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 index 901506d350b..00000000000 --- a/bin/tests/system/synthrecord/conf/bad-wrong-mode.conf.j2 +++ /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; -}; diff --git a/bin/tests/system/synthrecord/conf/bad-wrong-ttl-type.conf.j2 b/bin/tests/system/synthrecord/conf/bad-wrong-ttl-type.conf.j2 index 77021e65b17..db8014c9b98 100644 --- a/bin/tests/system/synthrecord/conf/bad-wrong-ttl-type.conf.j2 +++ b/bin/tests/system/synthrecord/conf/bad-wrong-ttl-type.conf.j2 @@ -11,15 +11,16 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/good-no-allow-synth.conf.j2 b/bin/tests/system/synthrecord/conf/good-no-allow-synth.conf.j2 index 990891041fc..a8ef0530160 100644 --- a/bin/tests/system/synthrecord/conf/good-no-allow-synth.conf.j2 +++ b/bin/tests/system/synthrecord/conf/good-no-allow-synth.conf.j2 @@ -11,9 +11,12 @@ * 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; + }; }; diff --git a/bin/tests/system/synthrecord/conf/good-no-ttl.conf.j2 b/bin/tests/system/synthrecord/conf/good-no-ttl.conf.j2 index 8f63b55ed55..4d05862fe54 100644 --- a/bin/tests/system/synthrecord/conf/good-no-ttl.conf.j2 +++ b/bin/tests/system/synthrecord/conf/good-no-ttl.conf.j2 @@ -11,14 +11,14 @@ * 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; }; diff --git a/bin/tests/system/synthrecord/conf/good1.conf.j2 b/bin/tests/system/synthrecord/conf/good1.conf.j2 index 6ff0739f63c..120b79b74df 100644 --- a/bin/tests/system/synthrecord/conf/good1.conf.j2 +++ b/bin/tests/system/synthrecord/conf/good1.conf.j2 @@ -11,15 +11,42 @@ * 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 index a0b176e8b87..00000000000 --- a/bin/tests/system/synthrecord/conf/good2.conf.j2 +++ /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 index aa36d5b2b07..00000000000 --- a/bin/tests/system/synthrecord/conf/good3.conf.j2 +++ /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.; -}; diff --git a/bin/tests/system/synthrecord/ns1/named.conf.j2 b/bin/tests/system/synthrecord/ns1/named.conf.j2 index a58dd8c1dff..7e53d4bdde2 100644 --- a/bin/tests/system/synthrecord/ns1/named.conf.j2 +++ b/bin/tests/system/synthrecord/ns1/named.conf.j2 @@ -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; }; }; diff --git a/bin/tests/system/synthrecord/tests_synthrecord.py b/bin/tests/system/synthrecord/tests_synthrecord.py index ceeca8a1b69..7f453ee7ea8 100644 --- a/bin/tests/system/synthrecord/tests_synthrecord.py +++ b/bin/tests/system/synthrecord/tests_synthrecord.py @@ -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")