From e6ac666d804191f5d5ff50ea6cd492fbecb9b35c Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 13 Aug 2019 07:41:01 +0200 Subject: [PATCH] dns/bind: small improvements for zone management (#1431) --- .../Bind/forms/dialogEditBindDomain.xml | 40 ++++++++++++------- .../Bind/forms/dialogEditBindRecord.xml | 12 +++--- .../mvc/app/views/OPNsense/Bind/general.volt | 23 ++++++++--- .../service/templates/OPNsense/Bind/domain.db | 2 +- 4 files changed, 50 insertions(+), 27 deletions(-) diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml index 4d864dca9..bdc30f69f 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindDomain.xml @@ -3,13 +3,24 @@ domain.enabled checkbox - This will enable or disable the ACL. + This will enable or disable this zone. + + + domain.domainname + + text + Set the name for this zone. Both forward and reverse zones may be specified, i.e. example.com or 0.168.192.in-addr.arpa. domain.type dropdown - Set the type for this domain. + Set the type for this zone. + + + + header + domain.masterip @@ -18,63 +29,62 @@ Set the IP address of master server when using slave mode. - domain.domainname - - text - Set the name for this ACL. + + header + domain.allowtransfer dropdown - Define an ACL where you allow which server can retrieve your zone. + Define an ACL where you allow which server can retrieve this zone. domain.allowquery dropdown - Define an ACL where you allow which client are allowed to query this domain. + Define an ACL where you allow which client are allowed to query this zone. domain.ttl text - Set the general TTL for this domain. + Set the general Time To Live for this zone. domain.refresh text - Set the time in seconds. + Set the time in seconds after which name servers should refresh the zone information. domain.retry text - Set the time in seconds. + Set the time in seconds after which name servers should retry requests if the master does not respond. domain.expire text - Set the time in seconds. + Set the time in seconds after which name servers should stop answering requests if the master does not respond. domain.negative text - Set the time in seconds. + Set the time in seconds after which an entry for a non-existent record should expire from cache. domain.mailadmin text - Set the mail address of domain admin. Please replace @ with a dot. + Set the mail address of zone admin. A @-sign will automatically be replaced with a dot in the zone data. domain.dnsserver text - Set the DNS Server hosting this file. This should be the FQDN of your Firewall. + Set the DNS server hosting this file. This should usually be the FQDN of your firewall where the BIND plugin is installed. diff --git a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindRecord.xml b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindRecord.xml index 4a23a93cf..41070e527 100644 --- a/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindRecord.xml +++ b/dns/bind/src/opnsense/mvc/app/controllers/OPNsense/Bind/forms/dialogEditBindRecord.xml @@ -3,30 +3,30 @@ record.enabled checkbox - This will enable or disable the ACL. + This will enable or disable this record. record.domain - + dropdown - Set the type for this record. + Select the zone for this record. record.name text - Set the name for this ACL. + Set the name for this record. record.type dropdown - Set the time in seconds. + Set the type for this record. record.value text - Set the time in seconds. + Set the value for this record. diff --git a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt index 805ed2ab0..7b74a8d42 100644 --- a/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt +++ b/dns/bind/src/opnsense/mvc/app/views/OPNsense/Bind/general.volt @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
  • {{ lang._('General') }}
  • {{ lang._('DNSBL') }}
  • {{ lang._('ACLs') }}
  • -
  • {{ lang._('Domains') }}
  • +
  • {{ lang._('Zones') }}
  • @@ -91,7 +91,7 @@ POSSIBILITY OF SUCH DAMAGE. {{ lang._('Enabled') }} {{ lang._('Type') }} - {{ lang._('Domain') }} + {{ lang._('Zone') }} {{ lang._('TTL') }} {{ lang._('Refresh') }} {{ lang._('Retry') }} @@ -113,12 +113,15 @@ POSSIBILITY OF SUCH DAMAGE.
    +
    +

    {{ lang._('Records') }}

    +
    - + @@ -147,8 +150,8 @@ POSSIBILITY OF SUCH DAMAGE. {{ partial("layout_partials/base_dialog",['fields':formDialogEditBindAcl,'id':'dialogEditBindAcl','label':lang._('Edit ACL')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogEditBindDomain,'id':'dialogEditBindDomain','label':lang._('Edit Domains')])}} -{{ partial("layout_partials/base_dialog",['fields':formDialogEditBindRecord,'id':'dialogEditBindRecord','label':lang._('Edit Records')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditBindDomain,'id':'dialogEditBindDomain','label':lang._('Edit Zone')])}} +{{ partial("layout_partials/base_dialog",['fields':formDialogEditBindRecord,'id':'dialogEditBindRecord','label':lang._('Edit Record')])}} 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 c5e2edf91..4db3961d8 100644 --- a/dns/bind/src/opnsense/service/templates/OPNsense/Bind/domain.db +++ b/dns/bind/src/opnsense/service/templates/OPNsense/Bind/domain.db @@ -4,7 +4,7 @@ {% if TARGET_FILTERS['OPNsense.bind.domain.domains.domain.' ~ loop.index0] %} {% if domaindb.enabled == '1' and domaindb.type == 'master' %} $TTL {{ domaindb.ttl }} -@ IN SOA {{ domaindb.dnsserver }}. {{ domaindb.mailadmin }}. ( {{ domaindb.serial|trim }} {{ domaindb.refresh }} {{ domaindb.retry }} {{ domaindb.expire }} {{ domaindb.negative }} ) +@ IN SOA {{ domaindb.dnsserver }}. {{ domaindb.mailadmin|replace('@', '.') }}. ( {{ domaindb.serial|trim }} {{ domaindb.refresh }} {{ domaindb.retry }} {{ domaindb.expire }} {{ domaindb.negative }} ) {% for record in helpers.sortDictList(OPNsense.bind.record.records.record, 'name', 'type' ) %} {% if record.domain == domaindb['@uuid'] %} {{ record.name }} {{ record.type }} {{ record.value }}
    {{ lang._('Enabled') }}{{ lang._('Domain') }}{{ lang._('Zone') }} {{ lang._('Name') }} {{ lang._('Type') }} {{ lang._('Value') }}