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 Settings")); $pglinks = array("", "@self", "@self"); $shortcut_section = "resolver"; include_once("head.inc"); if ($input_errors) { print_input_errors($input_errors); } if ($_POST['apply']) { print_apply_result_box($retval); } if (is_subsystem_dirty('unbound')) { print_apply_box(gettext("The DNS resolver configuration has been changed.") . "
" . gettext("The changes must be applied 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', 'resizable')->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', 'resizable')->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'] ))->setHelp('If this option is set, DNS queries will be forwarded to the upstream DNS servers defined under'. ' %1$sSystem > General Setup%2$s or those obtained via DHCP/PPP on WAN'. ' (if DNS Server Override is enabled there).','',''); $section->addInput(new Form_Checkbox( 'regdhcp', 'DHCP Registration', 'Register DHCP leases in the DNS Resolver', $pconfig['regdhcp'] ))->setHelp('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.'. ' The domain in %1$sSystem > General Setup%2$s should also be set to the proper value.','',''); $section->addInput(new Form_Checkbox( 'regdhcpstatic', 'Static DHCP', 'Register DHCP static mappings in the DNS Resolver', $pconfig['regdhcpstatic'] ))->setHelp('If this option is set, then DHCP static mappings will be registered in the DNS Resolver, so that their name can be resolved. '. 'The domain in %1$sSystem > General Setup%2$s should also be set to the proper value.','',''); $btnadv = new Form_Button( 'btnadvcustom', 'Custom options', null, 'fa-cog' ); $btnadv->setAttribute('type','button')->addClass('btn-info btn-sm'); $section->addInput(new Form_StaticText( 'Display Custom Options', $btnadv )); $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); ?>