various fixes for dns with froxlor-hostname

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2016-05-17 09:12:39 +02:00
parent f7441df895
commit 1ce5cf6c00
4 changed files with 68 additions and 51 deletions

View File

@@ -1,11 +1,13 @@
<?php
/***
* Class DnsBase
*
* Base class for all DNS server configs
*
*/
abstract class DnsBase {
abstract class DnsBase
{
protected $_logger = false;
@@ -81,6 +83,7 @@ abstract class DnsBase {
$hostname_arr = array(
'id' => 'none',
'domain' => Settings::Get('system.hostname'),
'isbinddomain' => '1',
'isemaildomain' => Settings::Get('system.dns_createmailentry'),
'customerid' => 'none',
'loginname' => 'froxlor.panel',
@@ -181,5 +184,4 @@ abstract class DnsBase {
$this->_logger->logAction(CRON_ACTION, LOG_INFO, 'Dkim-milter reloaded');
}
}
}
}

View File

@@ -46,7 +46,7 @@ class bind extends DnsBase
}
// create zone-file
$this->_logger->logAction(CRON_ACTION, LOG_DEBUG, 'Generating dns zone for ' . $domain['domain']);
$zone = createDomainZone($domain['id'], $isFroxlorHostname);
$zone = createDomainZone(($domain['id'] == 'none') ? $domain : $domain['id'], $isFroxlorHostname);
$zonefile = (string)$zone;
$domain['zonefile'] = 'domains/' . $domain['domain'] . '.zone';
$zonefile_name = makeCorrectFile(Settings::Get('system.bindconf_directory') . '/' . $domain['zonefile']);

View File

@@ -44,7 +44,7 @@ class pdns extends DnsBase
}
// create zone-file
$this->_logger->logAction(CRON_ACTION, LOG_DEBUG, 'Generating dns zone for ' . $domain['domain']);
$zone = createDomainZone($domain['id'], $isFroxlorHostname);
$zone = createDomainZone(($domain['id'] == 'none') ? $domain : $domain['id'], $isFroxlorHostname);
$dom_id = $this->_insertZone($zone->origin, $zone->serial);
$this->_insertRecords($dom_id, $zone->records);