Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbound / DNS64: add AAAA-only mode #5945

Merged
merged 2 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/etc/inc/plugins.inc.d/unbound.inc
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,15 @@ function unbound_generate_config()

$optimization = unbound_optimization();

$respip = '';
$dns64prefix = '';
if (isset($config['unbound']['dns64'])) {
$module_config = 'dns64 ';
if (isset($config['unbound']['noarecords'])) {
$module_config = 'respip dns64 ';
$respip = "response-ip: 0.0.0.0/0 redirect";
} else {
$module_config = 'dns64 ';
}
if (!empty($config['unbound']['dns64prefix'])) {
$dns64prefix = "dns64-prefix: {$config['unbound']['dns64prefix']}";
}
Expand Down Expand Up @@ -345,6 +351,7 @@ rrset-cache-size: {$rrsetcachesize}m
{$anchor_file}
{$forward_local}
{$dns64prefix}
{$respip}
prefetch: {$prefetch}
prefetch-key: {$prefetch_key}

Expand Down
8 changes: 8 additions & 0 deletions src/www/services_unbound.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
$pconfig['enable_wpad'] = isset($a_unboundcfg['enable_wpad']);
$pconfig['dnssec'] = isset($a_unboundcfg['dnssec']);
$pconfig['dns64'] = isset($a_unboundcfg['dns64']);
$pconfig['noarecords'] = isset($a_unboundcfg['noarecords']);
$pconfig['reglladdr6'] = empty($a_unboundcfg['noreglladdr6']);
$pconfig['regdhcp'] = isset($a_unboundcfg['regdhcp']);
$pconfig['regdhcpstatic'] = isset($a_unboundcfg['regdhcpstatic']);
Expand Down Expand Up @@ -113,6 +114,7 @@
// boolean values
$a_unboundcfg['cacheflush'] = !empty($pconfig['cacheflush']);
$a_unboundcfg['dns64'] = !empty($pconfig['dns64']);
$a_unboundcfg['noarecords'] = !empty($pconfig['noarecords']);
$a_unboundcfg['dnssec'] = !empty($pconfig['dnssec']);
$a_unboundcfg['enable'] = !empty($pconfig['enable']);
$a_unboundcfg['enable_wpad'] = !empty($pconfig['enable_wpad']);
Expand Down Expand Up @@ -246,6 +248,12 @@
<?= gettext("If no DNS64 prefix is specified, the default prefix " .
"64:ff9b::/96 (RFC 6052) will be used."); ?>
</div>
<input name="noarecords" type="checkbox" id="noarecords" value="yes" <?=!empty($pconfig['noarecords']) ? 'checked="checked"' : '';?> />
<?= gettext('Enable AAAA-only mode') ?>
<div class="hidden" data-for="help_for_dns64">
<?= gettext("If this option is set, Unbound will remove all A " .
"records from the answer section of all responses."); ?>
</div>
</td>
</tr>
<tr>
Expand Down