diff --git a/src/etc/config.xml.sample b/src/etc/config.xml.sample
index d6a063785..616bcf09b 100644
--- a/src/etc/config.xml.sample
+++ b/src/etc/config.xml.sample
@@ -289,9 +289,6 @@
-
- 1
-
@@ -381,4 +378,12 @@
system_information-container:00000000-col3:show,services_status-container:00000001-col4:show,gateways-container:00000002-col4:show,interface_list-container:00000003-col4:show
2
+
+
+
+ 1
+ 53
+
+
+
diff --git a/src/etc/inc/plugins.inc.d/unbound.inc b/src/etc/inc/plugins.inc.d/unbound.inc
index 2e496ca31..2d30f14bf 100644
--- a/src/etc/inc/plugins.inc.d/unbound.inc
+++ b/src/etc/inc/plugins.inc.d/unbound.inc
@@ -221,7 +221,7 @@ function unbound_generate_config()
unbound_add_host_entries($ifconfig_details);
unbound_acls_config();
- $port = $general['port'] ?? '53';
+ $port = $general['port'];
/* do not touch prefer-ip6 as it is defaulting to 'no' anyway */
$do_ip6 = isset($config['system']['ipv6allow']) ? 'yes' : 'no';
diff --git a/src/opnsense/mvc/app/models/OPNsense/Unbound/Migrations/M1_0_5.php b/src/opnsense/mvc/app/models/OPNsense/Unbound/Migrations/M1_0_5.php
index 39c4ddeb8..8aadc5f0d 100644
--- a/src/opnsense/mvc/app/models/OPNsense/Unbound/Migrations/M1_0_5.php
+++ b/src/opnsense/mvc/app/models/OPNsense/Unbound/Migrations/M1_0_5.php
@@ -39,13 +39,15 @@ class M1_0_5 extends BaseModelMigration
$new = [];
foreach ($model->general->iterateItems() as $key => $node) {
if (isset($config->unbound->$key)) {
+ if ($key == 'port' && empty($config->unbound->port)) {
+ $model->general->port->applyDefault();
+ continue;
+ }
$new[$key] = $config->unbound->$key;
}
}
- if (isset($config->unbound->enable)) {
- $new['enabled'] = $config->unbound->enable;
- }
+ $new['enabled'] = isset($config->unbound->enable) ? '1' : '0';
$model->general->setNodes($new);
}
diff --git a/src/wizard/system.xml b/src/wizard/system.xml
index 62837f12a..06f52c817 100644
--- a/src/wizard/system.xml
+++ b/src/wizard/system.xml
@@ -114,13 +114,13 @@
Enable Resolver
checkbox
yes
- unbound->enable
+ OPNsense->unboundplus->general->enabled
Enable DNSSEC Support
checkbox
- unbound->dnssec
+ OPNsense->unboundplus->general->dnssec
Harden DNSSEC data