{% set inview = inview | default(False) %}
{% set toolongprefix = toolongprefix | 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;
};

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

{% 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" {
{% if toolongprefix %}
		prefix "waytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefixwaytoolongprefix";
{% else %}
		prefix "dynamic-";
{% endif %}
		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;
	};
};
