/*
 * 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.
 */
{% set inview = inview | default(False) %}

options {
	query-source address 10.53.0.1;
	port @PORT@;
	pid-file "named.pid";
	listen-on { 10.53.0.1; };
	listen-on-v6 { fd92:7065:b8e:ffff::1; };
	recursion no;
};

key rndc_key {
	secret "1234abcd8765";
	algorithm @DEFAULT_HMAC@;
};

controls {
	inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};

{% if inview %}
plugin query "@TOP_BUILDDIR@/synthrecord" {
	prefix "dynamic-";
	allow-synth {
		10.53.0.0/24;
		10.53.1.0/29;
		192.168.1.0/24;
		192.180.0.0/18;
		cafe:cafe::/32;
		::/16;
	};
	origin example.;
	ttl 3600;
};
{% endif %}

zone "example" {
	type primary;
	file "example.db";
	plugin query "@TOP_BUILDDIR@/synthrecord" {
		prefix "dynamic-";
		allow-synth {
			10.53.0.0/24;
			10.53.1.0/29;
			192.168.1.0/24;
			192.180.0.0/18;
			cafe:cafe::/32;
			::/16;
		};
		origin example.;
		ttl 3600;
	};
};

zone "0.53.10.in-addr.arpa." {
	type primary;
	file "0.53.10.in-addr.arpa.db";
	plugin query "@TOP_BUILDDIR@/synthrecord" {
		prefix "dynamic-";
		allow-synth {
			10.53.0.0/24;
		};
		origin example.;
		ttl 3600;
	};
};

zone "1.53.10.in-addr.arpa." {
	type primary;
	file "1.53.10.in-addr.arpa.db";
	plugin query "@TOP_BUILDDIR@/synthrecord" {
		prefix "dynamic-";
		allow-synth {
			10.53.1.0/29;
		};
		origin example.;
		ttl 3600;
	};
};

zone "0.16.172.in-addr.arpa." {
	type primary;
	file "0.16.172.in-addr.arpa.db";
};

zone "e.f.a.c.e.f.a.c.ip6.arpa." {
	type primary;
	file "e.f.a.c.e.f.a.c.ip6.arpa.db";
	plugin query "@TOP_BUILDDIR@/synthrecord" {
		prefix "dynamic-";
		allow-synth {
			cafe:cafe::/32;
		};
		origin example.;
		ttl 3600;
	};
};

zone "f.f.f.f.ip6.arpa." {
	type primary;
	file "f.f.f.f.ip6.arpa.db";
	plugin query "@TOP_BUILDDIR@/synthrecord" {
		prefix "dynamicdefaults-";
		origin example.;
	};
};

zone "0.0.0.0.ip6.arpa." {
	type primary;
	file "0.0.0.0.ip6.arpa.db";
	plugin query "@TOP_BUILDDIR@/synthrecord" {
		prefix "dynamic-";
		allow-synth {
			::/16;
		};
		origin example.;
		ttl 3600;
	};
};

zone "168.192.in-addr.arpa." {
	type primary;
	file "168.192.in-addr.arpa.db";
	plugin query "@TOP_BUILDDIR@/synthrecord" {
		prefix "dynamic-";
		allow-synth {
			192.168/16;
		};
		origin example.;
		ttl 3600;
	};
};
