array(), 'selected' => array());
$iflist['options']['all'] = "All";
if (empty($pconfig['interface']) || empty($pconfig['interface'][0]))
array_push($iflist['selected'], "all");
foreach ($interface_addresses as $laddr => $ldescr) {
$iflist['options'][$laddr] = htmlspecialchars($ldescr);
if ($pconfig['interface'] && in_array($laddr, $pconfig['interface']))
array_push($iflist['selected'], $laddr);
}
unset($interface_addresses);
return($iflist);
}
$closehead = false;
$pgtitle = array(gettext("Services"), gettext("DNS Resolver"));
$shortcut_section = "resolver";
include_once("head.inc");
if ($input_errors)
print_input_errors($input_errors);
if ($savemsg)
print_info_box($savemsg, 'success');
$tab_array = array();
$tab_array[] = array(gettext("General settings"), true, "services_unbound.php");
$tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php");
$tab_array[] = array(gettext("Access Lists"), false, "/services_unbound_acls.php");
display_top_tabs($tab_array, true);
require_once('classes/Form.class.php');
$form = new Form();
$section = new Form_Section('General DNS Resolver Options');
$section->addInput(new Form_Checkbox(
'enable',
'Enable',
'Enable DNS resolver',
$pconfig['enable']
));
$section->addInput(new Form_Input(
'port',
'Listen Port',
'text',
$pconfig['port']
))->setHelp('The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.');
$iflist = build_if_list();
$section->addInput(new Form_Select(
'active_interface',
'Network Interfaces',
$iflist['selected'],
$iflist['options'],
true
))->setHelp('Interface IPs used by the DNS Resolver for responding to queries from clients. If an interface has both IPv4 and IPv6 IPs, both are used. Queries to other interface IPs not selected below are discarded. ' .
'The default behavior is to respond to queries on every available IPv4 and IPv6 address.');
$section->addInput(new Form_Select(
'outgoing_interface',
'Outgoing Network Interfaces',
$iflist['selected'],
$iflist['options'],
true
))->setHelp('Utilize different network interface(s) that the DNS Resolver will use to send queries to authoritative servers and receive their replies. By default all interfaces are used.');
$section->addInput(new Form_Checkbox(
'dnssec',
'DNSSEC',
'Enable DNSSEC Support',
$pconfig['dnssec']
));
$section->addInput(new Form_Checkbox(
'forwarding',
'DNS Query Forwarding',
'Enable Forwarding Mode',
$pconfig['forwarding']
));
$section->addInput(new Form_Checkbox(
'regdhcp',
'DHCP Registration',
'Register DHCP leases in the DNS Resolver',
$pconfig['regdhcp']
))->setHelp(sprintf('If this option is set, then machines that specify their hostname when requesting a DHCP lease will be registered'.
' in the DNS Resolver, so that their name can be resolved.'.
' You should also set the domain in %sSystem: General setup%s to the proper value.','',''));
$section->addInput(new Form_Checkbox(
'regdhcpstatic',
'Static DHCP',
'Register DHCP static mappings in the DNS Resolver',
$pconfig['regdhcpstatic']
))->setHelp(sprintf('If this option is set, then DHCP static mappings will be registered in the DNS Resolver, so that their name can be '.
'resolved. You should also set the domain in %s'.
'System: General setup%s to the proper value.','',''));
$section->addInput(new Form_Checkbox(
'txtsupport',
'TXT Comment Support',
'Register DHCP static mappings in the DNS Resolver',
$pconfig['txtsupport']
))->setHelp('Any descriptions associated with Host entries and DHCP Static mappings will create a corresponding TXT record.');
$btnadvdns = new Form_Button(
'btnadvdns',
'Advanced'
);
$btnadvdns->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText(
'Advanced',
$btnadvdns . ' ' . 'Show advanced optionss'
));
$section->addInput(new Form_TextArea (
'custom_options',
'Custom options',
$pconfig['custom_options']
))->setHelp('Enter any additional configuration parameters to add to the DNS Resolver configuration here, separated by a newline');
$form->add($section);
print($form);
print_info_box(sprintf(gettext("If the DNS Resolver is enabled, the DHCP".
" service (if enabled) will automatically serve the LAN IP".
" address as a DNS server to DHCP clients so they will use".
" the DNS Resolver. If Forwarding, is enabled, the DNS Resolver will use the DNS servers".
" entered in %sSystem: General setup%s".
" or those obtained via DHCP or PPP on WAN if the "Allow".
" DNS server list to be overridden by DHCP/PPP on WAN"".
" is checked."),'',''));
?>