From 1bab1a2665febb7a9f69adccacda1e7dc92574ed Mon Sep 17 00:00:00 2001 From: Stuart Wyatt Date: Thu, 9 Apr 2015 09:39:47 -0700 Subject: BIND - add support for IPv6 reverse zones Add a supplemental checkbox to "Reverse Zone" which further qualifies the reverse zone as an IPv6 reverse zone. The resulting zone name will be *.ipv6.arpa rather than *.ip-addr.arpa This change was originally submitted by https://github.com/cuteredstorm/pfsense-packages/commit/2b4e8084a92c8e9936f1b2fdca8272d29217c20a for Bug #4553 --- config/bind/bind.inc | 18 ++++++++++++++++-- config/bind/bind_zones.xml | 7 +++++++ 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'config/bind') diff --git a/config/bind/bind.inc b/config/bind/bind.inc index 77f3a770..747fdc27 100644 --- a/config/bind/bind.inc +++ b/config/bind/bind.inc @@ -349,6 +349,7 @@ EOD; $zoneipslave = $zone['slaveip']; $zoneforwarders = $zone['forwarders']; $zonereverso = $zone['reverso']; + $zonereversv6o = $zone['reversv6o']; // Ensure zone view folder exists if (!(is_dir(CHROOT_LOCALBASE."/etc/namedb/$zonetype/$zoneview"))) { @@ -374,7 +375,11 @@ EOD; if ($zoneview == $viewname) { // Add zone name if ($zonereverso == "on") { - $bind_conf .= "\tzone \"$zonename.in-addr.arpa\" {\n"; + if ($zonereversv6o == "on") { + $bind_conf .= "\tzone \"$zonename.ip6.arpa\" {\n"; + } else { + $bind_conf .= "\tzone \"$zonename.in-addr.arpa\" {\n"; + } } else { $bind_conf .= "\tzone \"$zonename\" {\n"; } @@ -442,10 +447,15 @@ EOD; $zonenameserver = $zone['nameserver']; $zoneipns = $zone['ipns']; $zonereverso = $zone['reverso']; + $zonereversv6o = $zone['reversv6o']; $zone_conf = "\$TTL {$zonetll}\n;\n"; if ($zonereverso == "on") { - $zone_conf .= "\$ORIGIN {$zonename}.in-addr.arpa.\n\n"; + if ($zonereversv6o == "on") { + $zone_conf .= "\$ORIGIN {$zonename}.ip6.arpa.\n\n"; + } else { + $zone_conf .= "\$ORIGIN {$zonename}.in-addr.arpa.\n\n"; + } } else { $zone_conf .= "\$ORIGIN {$zonename}.\n\n"; } @@ -706,6 +716,7 @@ function bind_print_javascript_type_zone() document.iform.tll.disabled = 0; document.iform.nameserver.disabled = 0; document.iform.reverso.disabled = 0; + document.iform.reversv6o.disabled = 0; document.iform.forwarders.disabled = 1; document.iform.dnssec.disabled = 0; document.iform.backupkeys.disabled = 0; @@ -723,6 +734,7 @@ function bind_print_javascript_type_zone() document.iform.tll.disabled = 1; document.iform.nameserver.disabled = 1; document.iform.reverso.disabled = 0; + document.iform.reversv6o.disabled = 0; document.iform.forwarders.disabled = 1; document.iform.dnssec.disabled = 0; document.iform.backupkeys.disabled = 0; @@ -740,6 +752,7 @@ function bind_print_javascript_type_zone() document.iform.tll.disabled = 1; document.iform.nameserver.disabled = 1; document.iform.reverso.disabled = 1; + document.iform.reversv6o.disabled = 1; document.iform.forwarders.disabled = 0; document.iform.dnssec.disabled = 1; document.iform.backupkeys.disabled = 1; @@ -757,6 +770,7 @@ function bind_print_javascript_type_zone() document.iform.tll.disabled = 1; document.iform.nameserver.disabled = 0; document.iform.reverso.disabled = 1; + document.iform.reversv6o.disabled = 1; document.iform.forwarders.disabled = 1; document.iform.dnssec.disabled = 1; document.iform.backupkeys.disabled = 1; diff --git a/config/bind/bind_zones.xml b/config/bind/bind_zones.xml index a62c1aaf..a227aabd 100644 --- a/config/bind/bind_zones.xml +++ b/config/bind/bind_zones.xml @@ -165,6 +165,13 @@ reverso Enable if this is a reverse zone. checkbox + reversv6o + + + IPv6 Reverse Zone + reversv6o + Enable if this is a IPv6 reverse zone. Reverse Zone must also be enabled. + checkbox Custom Option -- cgit v1.2.3