fix(templates): render allow-notify and correct allow-query-on statement
The zone option allow_notify was documented in defaults/main.yaml but never rendered by named.conf.views.j2. Any allow_notify list configured for a zone was silently dropped, so secondaries kept accepting NOTIFY messages only from the hosts listed in the masters statement. In addition, the allow_query_on block emitted the statement name allow-query instead of allow-query-on. This produced a second allow-query clause in the same zone and thereby overrode the interface restriction that was actually intended. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -15,6 +15,25 @@ view "{{ view.name }}" {
|
|||||||
{% for zone in view.zones %}
|
{% for zone in view.zones %}
|
||||||
zone "{{ zone.config.origin }}" {
|
zone "{{ zone.config.origin }}" {
|
||||||
|
|
||||||
|
# allow-notify applies to slave zones only and defines a match list,
|
||||||
|
# e.g. IP address(es), that are allowed to NOTIFY the slave in
|
||||||
|
# addition to those hosts defined in the masters statement. By
|
||||||
|
# default only the hosts of the masters statement may send NOTIFY
|
||||||
|
# messages.
|
||||||
|
#
|
||||||
|
# NOTE:
|
||||||
|
# - This statement may be used in a zone, view or a global options
|
||||||
|
# clause.
|
||||||
|
{% if zone.config.allow_notify is defined and zone.config.allow_notify | length > 0 %}
|
||||||
|
allow-notify {
|
||||||
|
{% for entry in zone.config.allow_notify %}
|
||||||
|
{{ entry }};
|
||||||
|
{% endfor %}
|
||||||
|
};
|
||||||
|
{% else %}
|
||||||
|
# allow-notify {};
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# Hosts which are allowed to issue queries to the server. If not specified all
|
# Hosts which are allowed to issue queries to the server. If not specified all
|
||||||
# hosts are allowed to make queries (defaults to allow-query {any;};
|
# hosts are allowed to make queries (defaults to allow-query {any;};
|
||||||
#
|
#
|
||||||
@@ -41,7 +60,7 @@ view "{{ view.name }}" {
|
|||||||
# - The statements may be used in a zone, view or a global options
|
# - The statements may be used in a zone, view or a global options
|
||||||
# clause.
|
# clause.
|
||||||
{% if zone.config.allow_query_on is defined and zone.config.allow_query_on | length > 0 %}
|
{% if zone.config.allow_query_on is defined and zone.config.allow_query_on | length > 0 %}
|
||||||
allow-query {
|
allow-query-on {
|
||||||
{% for entry in zone.config.allow_query_on %}
|
{% for entry in zone.config.allow_query_on %}
|
||||||
{{ entry }};
|
{{ entry }};
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user