diff --git a/dns/bind/pkg-descr b/dns/bind/pkg-descr index 31cc0ebc0..344006191 100644 --- a/dns/bind/pkg-descr +++ b/dns/bind/pkg-descr @@ -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 diff --git a/dns/bind/src/etc/inc/plugins.inc.d/bind.inc b/dns/bind/src/etc/inc/plugins.inc.d/bind.inc index 12ef025c5..a435fac63 100644 --- a/dns/bind/src/etc/inc/plugins.inc.d/bind.inc +++ b/dns/bind/src/etc/inc/plugins.inc.d/bind.inc @@ -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'],