diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-06-14 23:27:37 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-06-14 23:27:37 +0000 |
commit | 0c2b5df78fd3b8563f4b3c4871dabd4d2927e5cb (patch) | |
tree | 191f2cef7cd3658d2a2f370f5ccbedf25839fe56 /usr/local | |
parent | 28014b76528dd8410b5cf7a98ff276d530d8f311 (diff) | |
download | pfsense-0c2b5df78fd3b8563f4b3c4871dabd4d2927e5cb.zip pfsense-0c2b5df78fd3b8563f4b3c4871dabd4d2927e5cb.tar.gz |
Initial commit of dnsmasq domain overrides
Submitted-to-m0n0wall-dev-by: Joe Suhre
The patch adds the ability to make use of dnsmasq's --server=/domain/auth_server ARG in
order to force queries for domain to a specific dns server rather then
doing a full recursive query
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/guiconfig.inc | 2 | ||||
-rwxr-xr-x | usr/local/www/services_dnsmasq.php | 69 |
2 files changed, 62 insertions, 9 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 3c8d5f3..0c0f8d0 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -52,7 +52,7 @@ $d_filterconfdirty_path = $g['varrun_path'] . "/filter.conf.dirty"; $d_ipsecconfdirty_path = $g['varrun_path'] . "/ipsec.conf.dirty"; $d_shaperconfdirty_path = $g['varrun_path'] . "/shaper.conf.dirty"; $d_pptpuserdirty_path = $g['varrun_path'] . "/pptpd.user.dirty"; -$d_hostsdirty_path = $g['varrun_path'] . "/hosts.dirty"; +$d_dnsmasqdirty_path = $g['varrun_path'] . "/dnsmasq.dirty"; $d_staticmapsdirty_path = $g['varrun_path'] . "/staticmaps.dirty"; $d_staticroutesdirty_path = $g['varrun_path'] . "/staticroutes.dirty"; $d_aliasesdirty_path = $g['varrun_path'] . "/aliases.dirty"; diff --git a/usr/local/www/services_dnsmasq.php b/usr/local/www/services_dnsmasq.php index 66c3a35..f488958 100755 --- a/usr/local/www/services_dnsmasq.php +++ b/usr/local/www/services_dnsmasq.php @@ -38,8 +38,14 @@ $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(); $a_hosts = &$config['dnsmasq']['hosts']; +$a_domainOverrides = &$config['dnsmasq']['domainoverrides']; if ($_POST) { @@ -65,14 +71,27 @@ if ($_POST) { } if ($_GET['act'] == "del") { - if ($a_hosts[$_GET['id']]) { - unset($a_hosts[$_GET['id']]); - write_config(); - touch($d_hostsdirty_path); - header("Location: services_dnsmasq.php"); - exit; - } + 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; + } + } } + + ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> @@ -171,7 +190,41 @@ if ($_GET['act'] == "del") { <td valign="middle"><a href="services_dnsmasq_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td> </tr> </table> - </tr> +<!-- update to enable domain overrides --> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <tr> + <td><p>Below you can override an entire domain by specifying an + authoritative dns server to be queried for that domain.</p></td> + </tr> + </table> + <table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr> + <td width="35%" class="listhdrr">Domain</td> + <td width="20%" class="listhdrr">IP</td> + <td width="35%" class="listhdr">Description</td> + <td width="10%" class="list"></td> + </tr> + <?php $i = 0; foreach ($a_domainOverrides as $doment): ?> + <tr> + <td class="listlr"> + <?=strtolower($doment['domain']);?> + </td> + <td class="listr"> + <?=$doment['ip'];?> + </td> + <td class="listbg"> + <?=htmlspecialchars($doment['descr']);?> + </td> + <td valign="middle" nowrap class="list"> <a href="services_dnsmasq_domainoverride_edit.php?id=<?=$i;?>"><img src="e.gif" width="17" height="17" bord +er="0"></a> + <a href="services_dnsmasq.php?act=del&type=doverride&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this domain overrid +e?')"><img src="x.gif" width="17" height="17" border="0"></a></td> + </tr> + <?php $i++; endforeach; ?> + <tr> + <td class="list" colspan="3"></td> + <td class="list"> <a href="services_dnsmasq_domainoverride_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td> + </tr> </table> </form> <?php include("fend.inc"); ?> |