--- /dev/null
+/*
+ * 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.
+ */
+
+/*
+ * The dnssec-policy is not defined. Should also be caught if it is inherited.
+ */
+
+options {
+ dnssec-policy default;
+};
+
+zone "example.net" {
+ type primary;
+ file "example.db";
+ max-zone-ttl 600;
+};
This should now be configured as part of :namedconf:ref:`dnssec-policy`.
Use of this option in :namedconf:ref:`options`, :namedconf:ref:`view`
- and :namedconf:ref:`zone` blocks has no effect on any zone for which
- a :namedconf:ref:`dnssec-policy` has also been configured. In zones
- without :namedconf:ref:`dnssec-policy`, this option is deprecated,
- and will be rendered non-operational in a future release.
+ and :namedconf:ref:`zone` blocks is a fatal error if
+ :namedconf:ref:`dnssec-policy` has also been configured for the same
+ zone. In zones without :namedconf:ref:`dnssec-policy`, this option is
+ deprecated, and will be rendered non-operational in a future release.
:any:`max-zone-ttl` specifies a maximum permissible TTL value in seconds.
For convenience, TTL-style time-unit suffixes may be used to specify the
}
}
+ /*
+ * Reject zones with both dnssec-policy and max-zone-ttl
+ * */
+ if (has_dnssecpolicy) {
+ obj = NULL;
+ (void)cfg_map_get(zoptions, "max-zone-ttl", &obj);
+ if (obj == NULL && voptions != NULL) {
+ (void)cfg_map_get(voptions, "max-zone-ttl", &obj);
+ }
+ if (obj == NULL && goptions != NULL) {
+ (void)cfg_map_get(goptions, "max-zone-ttl", &obj);
+ }
+ if (obj != NULL) {
+ cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
+ "zone '%s': option 'max-zone-ttl' "
+ "cannot be used together with "
+ "'dnssec-policy'",
+ znamestr);
+ if (result == ISC_R_SUCCESS) {
+ result = ISC_R_FAILURE;
+ }
+ }
+ }
+
/*
* Check validity of the zone options.
*/