Skip to content
This repository has been archived by the owner on Jan 22, 2018. It is now read-only.

Commit

Permalink
BIND - add support for IPv6 reverse zones
Browse files Browse the repository at this point in the history
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 jozemlakar@2b4e808 for Bug #4553
  • Loading branch information
gogglespisano committed Apr 9, 2015
1 parent 52d9fc6 commit 1bab1a2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
18 changes: 16 additions & 2 deletions config/bind/bind.inc
Expand Up @@ -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"))) {
Expand All @@ -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";
}
Expand Down Expand Up @@ -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";
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions config/bind/bind_zones.xml
Expand Up @@ -165,6 +165,13 @@
<fieldname>reverso</fieldname>
<description>Enable if this is a reverse zone.</description>
<type>checkbox</type>
<enablefields>reversv6o</enablefields>
</field>
<field>
<fielddescr>IPv6 Reverse Zone</fielddescr>
<fieldname>reversv6o</fieldname>
<description>Enable if this is a IPv6 reverse zone. Reverse Zone must also be enabled.</description>
<type>checkbox</type>
</field>
<field>
<fielddescr>Custom Option</fielddescr>
Expand Down

0 comments on commit 1bab1a2

Please sign in to comment.