/*
 * 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.
 */

// NS3

options {
	{% include_indented "_common/options.conf.j2" %}
	allow-transfer { any; };
	recursion no;
	dnssec-validation yes;
	session-keyfile "session.key";
	minimal-responses no;
};

{% include "_common/controls.conf.j2" %}

dnssec-policy "dnssec" {
	keys {
		ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
		zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
	};
};

dnssec-policy "nsec3" {
	keys {
		ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
		zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
	};

	nsec3param iterations 0 optout no salt-length 0;
};

dnssec-policy "autonsec" {
	keys {
		ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
		zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
		ksk key-directory lifetime unlimited algorithm @ALTERNATIVE_ALGORITHM@;
		zsk key-directory lifetime unlimited algorithm @ALTERNATIVE_ALGORITHM@;
	};
};

dnssec-policy "autonsec3" {
	keys {
		ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
		zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
		ksk key-directory lifetime unlimited algorithm @ALTERNATIVE_ALGORITHM@;
		zsk key-directory lifetime unlimited algorithm @ALTERNATIVE_ALGORITHM@;
	};

	nsec3param iterations 0 optout no salt-length 0;
};

{% include "_common/root.hint.conf" %}

zone "example" {
	type secondary;
	primaries { 10.53.0.2; };
	file "example.bk";
};

zone "secure.example" {
	type primary;
	file "secure.example.db.signed";
	allow-update { any; };
};

zone "badalg.secure.example" {
	type primary;
	file "badalg.secure.example.db.signed";
	allow-update { any; };
};

zone "zonecut.ent.secure.example" {
	type primary;
	file "zonecut.ent.secure.example.db.signed";
	allow-update { any; };
};

zone "bogus.example" {
	type primary;
	file "bogus.example.db.signed";
	allow-update { any; };
};

zone "keytrap.example" {
	type primary;
	file "keytrap.example.db.signed";
};

zone "keytrap2.example" {
	type primary;
	file "keytrap2.example.db.signed";
};

zone "keytrap3.example" {
	type primary;
	file "keytrap3.example.db.signed";
};

zone "badds.example" {
	type primary;
	file "badds.example.db.signed";
	allow-update { any; };
};

zone "dynamic.example" {
	type primary;
	file "dynamic.example.db.signed";
	allow-update { any; };
};

zone "insecure.example" {
	type primary;
	file "insecure.example.db";
	allow-update { any; };
};

zone "insecure2.example" {
	type primary;
	file "insecure2.example.db";
	allow-update { any; };
};

zone "extrabadkey.example" {
	type primary;
	file "extrabadkey.example.db.signed";
	allow-update { any; };
};

zone "insecure.nsec3.example" {
	type primary;
	file "insecure.nsec3.example.db";
	allow-update { any; };
};

zone "insecure.optout.example" {
	type primary;
	file "insecure.optout.example.db";
	allow-update { any; };
};

zone "keyless.example" {
	type primary;
	file "keyless.example.db.signed";
};

zone "nsec3.example" {
	type primary;
	file "nsec3.example.db.signed";
};

zone "optout.nsec3.example" {
	type primary;
	file "optout.nsec3.example.db.signed";
};

zone "nsec3.nsec3.example" {
	type primary;
	file "nsec3.nsec3.example.db.signed";
};

zone "secure.nsec3.example" {
	type primary;
	file "secure.nsec3.example.db.signed";
};

zone "optout.example" {
	type primary;
	file "optout.example.db.signed";
};

zone "secure.optout.example" {
	type primary;
	file "secure.optout.example.db.signed";
};

zone "nsec3.optout.example" {
	type primary;
	file "nsec3.optout.example.db.signed";
};

zone "optout.optout.example" {
	type primary;
	file "optout.optout.example.db.signed";
};

zone "nsec3-unknown.example" {
	type primary;
	nsec3-test-zone yes;
	file "nsec3-unknown.example.db.signed";
};

zone "optout-unknown.example" {
	type primary;
	nsec3-test-zone yes;
	file "optout-unknown.example.db.signed";
};

zone "dnskey-unknown.example" {
	type primary;
	file "dnskey-unknown.example.db.signed";
};

zone "digest-alg-unsupported.example" {
	type primary;
	file "digest-alg-unsupported.example.db.signed";
	allow-update { any; };
};

zone "ds-unsupported.example" {
	type primary;
	file "ds-unsupported.example.db.signed";
	allow-update { any; };
};

zone "dnskey-unsupported.example" {
	type primary;
	file "dnskey-unsupported.example.db.signed";
};

zone "dnskey-unsupported-2.example" {
	type primary;
	file "dnskey-unsupported-2.example.db.signed";
};

zone "dnskey-nsec3-unknown.example" {
	type primary;
	nsec3-test-zone yes;
	file "dnskey-nsec3-unknown.example.db.signed";
};

zone "multiple.example" {
	type primary;
	file "multiple.example.db.signed";
	allow-update { any; };
};

zone "rfc2335.example" {
	type secondary;
	primaries { 10.53.0.2; };
	file "rfc2335.example.bk";
};

zone "rsasha256.example" {
	type primary;
	file "rsasha256.example.db.signed";
};

zone "rsasha512.example" {
	type primary;
	file "rsasha512.example.db.signed";
};

zone "kskonly.example" {
	type primary;
	file "kskonly.example.db.signed";
};

zone "expired.example" {
	type primary;
	allow-update { none; };
	file "expired.example.db.signed";
};

zone "update-nsec3.example" {
	type primary;
	dnssec-policy nsec3;
	allow-update { any; };
	file "update-nsec3.example.db.signed";
};

zone "auto-nsec.example" {
	type primary;
	dnssec-policy autonsec;
	allow-update { !0.0.0.0; };
	file "auto-nsec.example.db.signed";
};

zone "auto-nsec3.example" {
	type primary;
	dnssec-policy autonsec3;
	allow-update { !0.0.0.0; };
	file "auto-nsec3.example.db.signed";
};

zone "insecure.below-cname.example" {
	type primary;
	file "insecure.below-cname.example.db";
};

zone "secure.below-cname.example" {
	type primary;
	file "secure.below-cname.example.db.signed";
};

zone "ttlpatch.example" {
	type primary;
	file "ttlpatch.example.db.patched";
};

zone "split-dnssec.example" {
	type primary;
	file "split-dnssec.example.db";
};

zone "split-smart.example" {
	type primary;
	file "split-smart.example.db";
};

zone "nsec3chain-test" {
	type secondary;
	file "nsec3chain-test.bk";
	primaries { 10.53.0.2; };
};

zone "expiring.example" {
	type primary;
	allow-update { any; };
	file "expiring.example.db.signed";
};

zone "upper.example" {
	type primary;
	file "upper.example.db.signed";
};

zone "LOWER.EXAMPLE" {
	type primary;
	file "lower.example.db.signed";
};

zone "inline.example" {
	type primary;
	file "inline.example.db";
	inline-signing yes;
	dnssec-policy dnssec;
};

zone "future.example" {
	type primary;
	file "future.example.db.signed";
};

zone "managed-future.example" {
	type primary;
	file "managed-future.example.db.signed";
	allow-update { any; };
};

zone "revkey.example" {
	type primary;
	file "revkey.example.db.signed";
};

zone "dname-at-apex-nsec3.example" {
	type primary;
	file "dname-at-apex-nsec3.example.db.signed";
};

zone "occluded.example" {
	type primary;
	file "occluded.example.db.signed";
};

zone "secure.managed" {
	type primary;
	file "secure.managed.db.signed";
};

zone "disabled.managed" {
	type primary;
	file "disabled.managed.db.signed";
};

zone "enabled.managed" {
	type primary;
	file "enabled.managed.db.signed";
};

zone "unsupported.managed" {
	type primary;
	file "unsupported.managed.db.signed";
};

zone "revoked.managed" {
	type primary;
	file "revoked.managed.db.signed";
};

zone "secure.trusted" {
	type primary;
	file "secure.trusted.db.signed";
};

zone "disabled.trusted" {
	type primary;
	file "disabled.trusted.db.signed";
};

zone "enabled.trusted" {
	type primary;
	file "enabled.trusted.db.signed";
};

zone "unsupported.trusted" {
	type primary;
	file "unsupported.trusted.db.signed";
};

zone "revoked.trusted" {
	type primary;
	file "revoked.trusted.db.signed";
};

zone "too-many-iterations" {
	type secondary;
	primaries { 10.53.0.2; };
	file "too-many-iterations.bk";
};

zone "rsasha1.example" {
	type primary;
	file "rsasha1.example.db";
};

zone "rsasha1-1024.example" {
	type primary;
	file "rsasha1-1024.example.db";
};

dnssec-policy "siginterval1" {
	keys {
		ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
		zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
	};

	signatures-validity 1d;
	signatures-refresh 21h;
	signatures-validity-dnskey 90d;
};

dnssec-policy "siginterval2" {
	keys {
		ksk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
		zsk key-directory lifetime unlimited algorithm @DEFAULT_ALGORITHM@;
	};

	signatures-validity 35d;
	signatures-refresh 28d;
	signatures-validity-dnskey 90d;
};

include "siginterval.conf";

include "trusted.conf";
