array(), 'selected' => array()); $iflist['options']['all'] = gettext("All"); if (empty($selectedifs) || empty($selectedifs[0]) || in_array("all", $selectedifs)) { array_push($iflist['selected'], "all"); } foreach ($interface_addresses as $laddr => $ldescr) { $iflist['options'][$laddr] = htmlspecialchars($ldescr); if ($selectedifs && in_array($laddr, $selectedifs)) { array_push($iflist['selected'], $laddr); } } unset($interface_addresses); return($iflist); } $pgtitle = array(gettext("Services"), gettext("DNS Resolver"), gettext("General")); $shortcut_section = "resolver"; include_once("head.inc"); if ($input_errors) { print_input_errors($input_errors); } if ($savemsg) { print_info_box($savemsg, 'success'); } if (is_subsystem_dirty('unbound')) { print_apply_box(gettext("The DNS Resolver configuration has been changed.") . "
" . gettext("You must apply the changes in order for them to take effect.")); } $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); $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', 'number', $pconfig['port'], ['placeholder' => '53'] ))->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.'); $activeiflist = build_if_list($pconfig['active_interface']); $section->addInput(new Form_Select( 'active_interface', 'Network Interfaces', $activeiflist['selected'], $activeiflist['options'], true ))->addClass('general')->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.'); $outiflist = build_if_list($pconfig['outgoing_interface']); $section->addInput(new Form_Select( 'outgoing_interface', 'Outgoing Network Interfaces', $outiflist['selected'], $outiflist['options'], true ))->addClass('general')->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_Select( 'system_domain_local_zone_type', 'System Domain Local Zone Type', $pconfig['system_domain_local_zone_type'], unbound_local_zone_types() ))->setHelp('The local-zone type used for the pfSense system domain (System | General Setup | Domain). Transparent is the default. Local-Zone type descriptions are available in the unbound.conf(5) manual pages.'); $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.','','')); $btnadvdns = new Form_Button( 'btnadvdns', 'Custom options' ); $btnadvdns->removeClass('btn-primary')->addClass('btn-default btn-sm'); $section->addInput(new Form_StaticText( 'Custom options', $btnadvdns . ' ' . 'Show custom options' )); $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); ?>

     
', ''), 'info', false)?>