dns/bind: slave zone master ip should be a list (#2424)

This commit is contained in:
gyorsok
2021-07-29 12:30:44 +02:00
committed by GitHub
parent 72d35cb714
commit 3462fcfc05
5 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
PLUGIN_NAME= bind
PLUGIN_VERSION= 1.17
PLUGIN_VERSION= 1.18
PLUGIN_COMMENT= BIND domain name service
PLUGIN_DEPENDS= bind916
PLUGIN_MAINTAINER= m.muenz@gmail.com
+4
View File
@@ -8,6 +8,10 @@ necessary for asking and answering name service questions.
Plugin Changelog
================
1.18
* Allow specifying multiple masters for slave zones
1.17
* Make "Allow Transfer" and "Allow Query" configuration available to slave zones (contributed by Ang Iongchun)
@@ -37,7 +37,9 @@
<field>
<id>domain.masterip</id>
<label>Master IP</label>
<type>text</type>
<style>tokenize</style>
<type>select_multiple</type>
<allownew>true</allownew>
<help>Set the IP address of master server when using slave mode.</help>
</field>
<field>
@@ -1,7 +1,7 @@
<model>
<mount>//OPNsense/bind/domain</mount>
<description>BIND domain configuration</description>
<version>1.0.0</version>
<version>1.0.1</version>
<items>
<domains>
<domain type="ArrayField">
@@ -17,8 +17,10 @@
<slave>slave</slave>
</OptionValues>
</type>
<masterip type="HostnameField">
<masterip type="NetworkField">
<Required>N</Required>
<FieldSeparator>,</FieldSeparator>
<asList>Y</asList>
</masterip>
<allownotifyslave type="NetworkField">
<Required>N</Required>
@@ -127,7 +127,7 @@ zone "rpzbing" { type master; file "/usr/local/etc/namedb/master/bing.db"; notif
{% if domain.enabled == '1' %}
{% set allow_transfer = helpers.getUUID(domain.allowtransfer) %}
{% set allow_query = helpers.getUUID(domain.allowquery) %}
zone "{{ domain.domainname }}" { type {{ domain.type }}; {% if domain.type == 'slave' %}masters { {{ domain.masterip }}; }; {% if domain.allownotifyslave is defined %} allow-notify { {{ domain.allownotifyslave.replace(',', '; ') }}; };{% endif %} file "/usr/local/etc/namedb/slave/{{ domain.domainname }}.db"; {% else %}file "/usr/local/etc/namedb/master/{{ domain.domainname }}.db"; {% endif %}{% if domain.allowtransfer is defined %} allow-transfer { {{ allow_transfer.name }}; };{% endif %}{% if domain.allowquery is defined %} allow-query { {{ allow_query.name }}; };{% endif %} };
zone "{{ domain.domainname }}" { type {{ domain.type }}; {% if domain.type == 'slave' %}masters { {{ domain.masterip.replace(',', '; ') }}; }; {% if domain.allownotifyslave is defined %} allow-notify { {{ domain.allownotifyslave.replace(',', '; ') }}; };{% endif %} file "/usr/local/etc/namedb/slave/{{ domain.domainname }}.db"; {% else %}file "/usr/local/etc/namedb/master/{{ domain.domainname }}.db"; {% endif %}{% if domain.allowtransfer is defined %} allow-transfer { {{ allow_transfer.name }}; };{% endif %}{% if domain.allowquery is defined %} allow-query { {{ allow_query.name }}; };{% endif %} };
{% endif %}
{% endfor %}
{% endif %}