#!/usr/local/bin/php and Manuel Kasper . All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ $pgtitle = array("Services", "DNS forwarder"); require("guiconfig.inc"); $pconfig['enable'] = isset($config['dnsmasq']['enable']); $pconfig['regdhcp'] = isset($config['dnsmasq']['regdhcp']); if (!is_array($config['dnsmasq']['hosts'])) { $config['dnsmasq']['hosts'] = array(); } if (!is_array($config['dnsmasq']['domainoverrides'])) { $config['dnsmasq']['domainoverrides'] = array(); } hosts_sort(); domainoverrides_sort(); $a_hosts = &$config['dnsmasq']['hosts']; $a_domainOverrides = &$config['dnsmasq']['domainoverrides']; if ($_POST) { $pconfig = $_POST; $config['dnsmasq']['enable'] = ($_POST['enable']) ? true : false; $config['dnsmasq']['regdhcp'] = ($_POST['regdhcp']) ? true : false; write_config(); $retval = 0; if (!file_exists($d_sysrebootreqd_path)) { config_lock(); $retval = services_dnsmasq_configure(); config_unlock(); } $savemsg = get_std_save_message($retval); if ($retval == 0) { if (file_exists($d_dnsmasqdirty_path)) unlink($d_dnsmasqdirty_path); } } if ($_GET['act'] == "del") { if ($_GET['type'] == 'host') { if ($a_hosts[$_GET['id']]) { unset($a_hosts[$_GET['id']]); write_config(); touch($d_dnsmasqdirty_path); header("Location: services_dnsmasq.php"); exit; } } elseif ($_GET['type'] == 'doverride') { if ($a_domainOverrides[$_GET['id']]) { unset($a_domainOverrides[$_GET['id']]); write_config(); touch($d_dnsmasqdirty_path); header("Location: services_dnsmasq.php"); exit; } } } ?>

You must apply the changes in order for them to take effect.");?>

> Enable DNS forwarder
> Register DHCP leases in DNS forwarder
If this option is set, then machines that specify their hostname when requesting a DHCP lease will be registered in the DNS forwarder, so that their name can be resolved. You should also set the domain in System: General setup to the proper value.

Note:
If the DNS forwarder 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 forwarder. The DNS forwarder will use the DNS servers entered in System: General setup 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. If you don't use that option (or if you use a static IP address on WAN), you must manually specify at least one DNS server on the System: General setup page.

You may enter records that override the results from the forwarders below.

Host Domain IP Description
         

Below you can override an entire domain by specifying an authoritative DNS server to be queried for that domain.

Domain IP Description