From e134d7dce84c7fb1fbdf9f38fbfc67520459ebbf Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 28 Aug 2019 10:16:36 +0200 Subject: [PATCH] dns/bind: fix template generation (#1469) --- dns/bind/Makefile | 2 +- dns/bind/pkg-descr | 4 ++++ .../src/opnsense/service/templates/OPNsense/Bind/domain.db | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dns/bind/Makefile b/dns/bind/Makefile index c7aebff53..d7d2eda0b 100644 --- a/dns/bind/Makefile +++ b/dns/bind/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= bind -PLUGIN_VERSION= 1.7 +PLUGIN_VERSION= 1.8 PLUGIN_COMMENT= BIND domain name service PLUGIN_DEPENDS= bind914 PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 628adee2b..0ba0cca32 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -8,6 +8,10 @@ necessary for asking and answering name service questions. Plugin Changelog ================ +1.8 + +* Fix template generation when there is only one zone configured + 1.7 * Rename "domain" to "zone", because both forward and reverse zones can be used[1] diff --git a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/domain.db b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/domain.db index 4db3961d8..d24ecd3ee 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/domain.db +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/domain.db @@ -1,7 +1,7 @@ {% if helpers.exists('OPNsense.bind.general.enabled') and OPNsense.bind.general.enabled == '1' %} {% if helpers.exists('OPNsense.bind.domain.domains.domain') %} {% for domaindb in helpers.toList('OPNsense.bind.domain.domains.domain') %} -{% if TARGET_FILTERS['OPNsense.bind.domain.domains.domain.' ~ loop.index0] %} +{% if TARGET_FILTERS['OPNsense.bind.domain.domains.domain.' ~ loop.index0] or TARGET_FILTERS['OPNsense.bind.domain.domains.domain'] %} {% if domaindb.enabled == '1' and domaindb.type == 'master' %} $TTL {{ domaindb.ttl }} @ IN SOA {{ domaindb.dnsserver }}. {{ domaindb.mailadmin|replace('@', '.') }}. ( {{ domaindb.serial|trim }} {{ domaindb.refresh }} {{ domaindb.retry }} {{ domaindb.expire }} {{ domaindb.negative }} )