mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
dns/bind: refine previous
It was decided we only want the 'ports' trick for DNS so make sure the prerequistes for it match the reality of the setup. This was we can also extend the validation of the DNS port like we are going to do for Unbound to ensure a functional DNS setup when multiple DNS servers are being used on the same box.
This commit is contained in:
@@ -14,6 +14,7 @@ Plugin Changelog
|
||||
|
||||
* Allow multiple ACLs to be selected for Transfers/Queries (contributed by Robbert Rijkse)
|
||||
* Rename Master/Slave to Primary/Secondary (contributed by Robbert Rijkse)
|
||||
* Add necessary hooks to allow the plugin to be used as a standalone core DNS server
|
||||
|
||||
1.25
|
||||
|
||||
|
||||
@@ -49,9 +49,22 @@ function bind_services()
|
||||
|
||||
$model = new \OPNsense\Bind\General();
|
||||
|
||||
/* DNS service is eligable for core use when both 127.0.0.1 and ::1 are set */
|
||||
$localhost4 = false;
|
||||
$localhost6 = false;
|
||||
|
||||
foreach (explode(',', (string)$model->listenv4) as $addr) {
|
||||
$localhost4 |= $addr === '127.0.0.1';
|
||||
}
|
||||
|
||||
foreach (explode(',', (string)$model->listenv6) as $addr) {
|
||||
$localhost6 |= $addr === '::1';
|
||||
}
|
||||
|
||||
$services[] = [
|
||||
/* the port may still be something other than 53, but it's safe to register a conflict for it */
|
||||
'ports' => ($localhost4 && $localhost6 ? [(string)$model->port] : []),
|
||||
'description' => gettext('BIND Daemon'),
|
||||
'ports' => [(string)$model->port],
|
||||
'configd' => [
|
||||
'restart' => ['bind restart'],
|
||||
'start' => ['bind start'],
|
||||
|
||||
Reference in New Issue
Block a user