/*
 * 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 max_stale_ttl = max_stale_ttl | default(3600) %}
{% set stale_answer_ttl = stale_answer_ttl | default(4) %}
{% set stale_refresh_time = stale_refresh_time | default(30) %}
{% set stale_test_zone = stale_test_zone | default(False) %}

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

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

options {
	query-source address 10.53.0.1;
	notify-source 10.53.0.1;
	transfer-source 10.53.0.1;
	port @PORT@;
	pid-file "named.pid";
	listen-on { 10.53.0.1; };
	listen-on-v6 { none; };
	allow-transfer { any; };
	recursion yes;
	dnssec-validation no;
	max-stale-ttl @max_stale_ttl@;
	stale-answer-ttl @stale_answer_ttl@;
	stale-answer-enable yes;
	stale-cache-enable yes;
{% if stale_refresh_time is not none %}
	stale-refresh-time @stale_refresh_time@;
{% endif %}
	servfail-ttl 0;
};

zone "." {
	type primary;
	file "root.db";
};

{% if stale_test_zone %}
zone "stale.test" {
	type primary;
	file "stale.test.db";
	allow-update { any; };
};
{% endif %}
