Commit 84113112 authored by anarcat's avatar anarcat Committed by anarcat

generate the NS list from the slave servers of the master

parent ba6581ff
...@@ -32,6 +32,18 @@ class provisionService_dns_bind extends provisionService_dns { ...@@ -32,6 +32,18 @@ class provisionService_dns_bind extends provisionService_dns {
} }
class provisionConfig_bind_zone extends provisionConfig_dns_zone { class provisionConfig_bind_zone extends provisionConfig_dns_zone {
/**
* this renders the slave servers names (as their alias is stored)
*/
function process() {
parent::process();
$slaves = array();
foreach ($this->server->slave_servers as $slave) {
$slaves[] = d($slave)->remote_host;
}
$this->data['server']->slave_servers_names = $slaves;
}
} }
class provisionConfig_bind_server extends provisionConfig_dns_server { class provisionConfig_bind_server extends provisionConfig_dns_server {
......
...@@ -20,9 +20,13 @@ if (!empty($server->dns_default_mx)) { ...@@ -20,9 +20,13 @@ if (!empty($server->dns_default_mx)) {
} }
print "@\tIN\tNS\t" . $server->remote_host . " ; primary DNS\n"; print "@\tIN\tNS\t" . $server->remote_host . " ; primary DNS\n";
if (is_array($server->slave_servers_names)) {
foreach ($server->dns_slaves as $slave) { foreach ($server->slave_servers_names as $slave) {
print "@\tIN\tNS\t$slave ; slave DNS\n"; if ($slave[strlen($slave)-1] != '.') {
$slave .= '.';
}
print "@\tIN\tNS\t" . $slave . " ; slave DNS\n";
}
} }
foreach ($records['@'] as $type => $destinations) { foreach ($records['@'] as $type => $destinations) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment