From 939c9a2b93a9bffa2bff95641740c666caec8e80 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Fri, 25 Oct 2013 20:20:09 -0200 Subject: bind - include custom zone records field --- config/bind/bind.inc | 16 ++++++++++------ config/bind/bind_zones.xml | 30 ++++++++++++++++++++++++------ 2 files changed, 34 insertions(+), 12 deletions(-) (limited to 'config/bind') diff --git a/config/bind/bind.inc b/config/bind/bind.inc index 21e88e15..009befff 100644 --- a/config/bind/bind.inc +++ b/config/bind/bind.inc @@ -396,18 +396,19 @@ EOD; if($zone['allowtransfer'] == '') $zoneallowtransfer = "none"; else - $zoneallowtransfer = str_replace(',','; ',$zone['allowtransfer']); - $zone_conf = "\$TTL $zonetll\n;\n"; + $zoneallowtransfer = str_replace(',','; ',$zone['allowtransfer']); + $zone_conf = "\$TTL {$zonetll}\n;\n"; + $zone_conf .= "\$ORIGIN {$zonename}.\n\n"; $zone_conf .= ";\tDatabase file {$zonename}.DB for {$zonename} zone.\n"; $zone_conf .= ";\tDo not edit this file!!!\n"; $zone_conf .= ";\tZone version {$zoneserial}\n;\n"; if($zonereverso == "on" || $zonetype =="redirect") - $zone_conf .= "@\t IN SOA $zonenameserver. \t $zonemail. (\n"; + $zone_conf .= "@\t IN SOA $zonenameserver. \t $zonemail. (\n"; else - $zone_conf .= "$zonename.\t IN SOA $zonenameserver. \t $zonemail. (\n"; + $zone_conf .= "$zonename.\t IN SOA $zonenameserver. \t $zonemail. (\n"; - $zone_conf .= "\t\t$zoneserial ; serial\n"; - $zone_conf .= "\t\t$zonerefresh ; refresh\n"; + $zone_conf .= "\t\t$zoneserial ; serial\n"; + $zone_conf .= "\t\t$zonerefresh ; refresh\n"; $zone_conf .= "\t\t$zoneretry ; retry\n"; $zone_conf .= "\t\t$zoneexpire ; expire\n"; $zone_conf .= "\t\t$zoneminimum ; default_ttl\n\t\t)\n\n"; @@ -431,6 +432,9 @@ EOD; $zone_conf .= "$hostname \t IN $hosttype $hostvalue \t$hostdst\n"; } + if ($zone['customzonerecords']!=""){ + $zone_conf .= "\n\n;\n;custom zone records\n;\n".base64_decode($zone['customzonerecords'])."\n"; + } file_put_contents(CHROOT_LOCALBASE."/etc/namedb/$zonetype/$zoneview/$zonename.DB", $zone_conf); $config["installedpackages"]["bindzone"]["config"][$x][resultconfig]=base64_encode($zone_conf); $write_config++; diff --git a/config/bind/bind_zones.xml b/config/bind/bind_zones.xml index d3adf630..7fde01a7 100644 --- a/config/bind/bind_zones.xml +++ b/config/bind/bind_zones.xml @@ -172,7 +172,7 @@ You can put your own custom options here. textarea 75 - 8 + 5 base64 @@ -384,18 +384,36 @@ - listtopic - Zone config file - temp03 + listtopic + Custom Zone Domain records + temp02 + + + + customzonerecords + + This can be used for a fast migration setup.]]> + textarea + 84 + 10 + base64 + + + + + listtopic + Resulting Zone config file - Resulting config file + resultconfig Resulting bind config file for this zone. textarea - 75 + 84 15 base64 + + -- cgit v1.2.3