Project

General

Profile

Download (21.3 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
<?php
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	services_dnsmasq.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6 f0fe3d30 Scott Ullrich
7 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Bob Zoller <bob@kludgebox.com> and Manuel Kasper <mk@neon1.net>.
8 6317d31d Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
9 5b237745 Scott Ullrich
	All rights reserved.
10 f0fe3d30 Scott Ullrich
11 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
12
	modification, are permitted provided that the following conditions are met:
13 f0fe3d30 Scott Ullrich
14 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
15
	   this list of conditions and the following disclaimer.
16 f0fe3d30 Scott Ullrich
17 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
18
	   notice, this list of conditions and the following disclaimer in the
19
	   documentation and/or other materials provided with the distribution.
20 f0fe3d30 Scott Ullrich
21 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
	POSSIBILITY OF SUCH DAMAGE.
31
*/
32 70edf50d jim-p
/*
33 1d333258 Scott Ullrich
	pfSense_MODULE:	dnsforwarder
34
*/
35 5b237745 Scott Ullrich
36 6b07c15a Matthew Grooms
##|+PRIV
37
##|*IDENT=page-services-dnsforwarder
38
##|*NAME=Services: DNS Forwarder page
39
##|*DESCR=Allow access to the 'Services: DNS Forwarder' page.
40
##|*MATCH=services_dnsmasq.php*
41
##|-PRIV
42
43 5b237745 Scott Ullrich
require("guiconfig.inc");
44 7a927e67 Scott Ullrich
require_once("functions.inc");
45
require_once("filter.inc");
46
require_once("shaper.inc");
47 4dbcf2fb Renato Botelho
require_once("system.inc");
48 5b237745 Scott Ullrich
49 70edf50d jim-p
$pconfig['enable'] = isset($config['dnsmasq']['enable']);
50 5b237745 Scott Ullrich
$pconfig['regdhcp'] = isset($config['dnsmasq']['regdhcp']);
51 6a01ea44 Bill Marquette
$pconfig['regdhcpstatic'] = isset($config['dnsmasq']['regdhcpstatic']);
52 aa994814 Andrew Thompson
$pconfig['dhcpfirst'] = isset($config['dnsmasq']['dhcpfirst']);
53 96ea7162 N0YB
$pconfig['strict_order'] = isset($config['dnsmasq']['strict_order']);
54
$pconfig['domain_needed'] = isset($config['dnsmasq']['domain_needed']);
55 7bdd28fb Phil Davis
$pconfig['no_private_reverse'] = isset($config['dnsmasq']['no_private_reverse']);
56 e6c49e3d jim-p
$pconfig['port'] = $config['dnsmasq']['port'];
57 8f9bffbc Andrew Thompson
$pconfig['custom_options'] = $config['dnsmasq']['custom_options'];
58 5b237745 Scott Ullrich
59 b4323f39 jim-p
$pconfig['strictbind'] = isset($config['dnsmasq']['strictbind']);
60 79d03c40 jim-p
if (!empty($config['dnsmasq']['interface']))
61
	$pconfig['interface'] = explode(",", $config['dnsmasq']['interface']);
62
else
63
	$pconfig['interface'] = array();
64 b4323f39 jim-p
65 70edf50d jim-p
if (!is_array($config['dnsmasq']['hosts']))
66 5b237745 Scott Ullrich
	$config['dnsmasq']['hosts'] = array();
67 0c2b5df7 Scott Ullrich
68 70edf50d jim-p
if (!is_array($config['dnsmasq']['domainoverrides']))
69
	$config['dnsmasq']['domainoverrides'] = array();
70 0c2b5df7 Scott Ullrich
71 4d6ba181 Scott Ullrich
72 70edf50d jim-p
$a_hosts = &$config['dnsmasq']['hosts'];
73 0c2b5df7 Scott Ullrich
$a_domainOverrides = &$config['dnsmasq']['domainoverrides'];
74 5b237745 Scott Ullrich
75
if ($_POST) {
76
77
	$pconfig = $_POST;
78 8f9bffbc Andrew Thompson
	unset($input_errors);
79 5b237745 Scott Ullrich
80
	$config['dnsmasq']['enable'] = ($_POST['enable']) ? true : false;
81
	$config['dnsmasq']['regdhcp'] = ($_POST['regdhcp']) ? true : false;
82 6a01ea44 Bill Marquette
	$config['dnsmasq']['regdhcpstatic'] = ($_POST['regdhcpstatic']) ? true : false;
83 aa994814 Andrew Thompson
	$config['dnsmasq']['dhcpfirst'] = ($_POST['dhcpfirst']) ? true : false;
84 96ea7162 N0YB
	$config['dnsmasq']['strict_order'] = ($_POST['strict_order']) ? true : false;
85
	$config['dnsmasq']['domain_needed'] = ($_POST['domain_needed']) ? true : false;
86 7bdd28fb Phil Davis
	$config['dnsmasq']['no_private_reverse'] = ($_POST['no_private_reverse']) ? true : false;
87 8f9bffbc Andrew Thompson
	$config['dnsmasq']['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
88 b4323f39 jim-p
	$config['dnsmasq']['strictbind'] = ($_POST['strictbind']) ? true : false;
89 8f9bffbc Andrew Thompson
90 e6c49e3d jim-p
	if ($_POST['port'])
91
		if(is_port($_POST['port']))
92
			$config['dnsmasq']['port'] = $_POST['port'];
93
		else
94
			$input_errors[] = gettext("You must specify a valid port number");
95
	else if (isset($config['dnsmasq']['port']))
96
		unset($config['dnsmasq']['port']);
97
98 b4323f39 jim-p
	if (is_array($_POST['interface']))
99
		$config['dnsmasq']['interface'] = implode(",", $_POST['interface']);
100
	elseif (isset($config['dnsmasq']['interface']))
101
		unset($config['dnsmasq']['interface']);
102 e6c49e3d jim-p
103 8f9bffbc Andrew Thompson
	if ($config['dnsmasq']['custom_options']) {
104
		$args = '';
105
		foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c)
106 071f6059 jim-p
			$args .= escapeshellarg("--{$c}") . " ";
107 8f9bffbc Andrew Thompson
		exec("/usr/local/sbin/dnsmasq --test $args", $output, $rc);
108
		if ($rc != 0)
109
			$input_errors[] = gettext("Invalid custom options");
110
	}
111 5b237745 Scott Ullrich
112 8f9bffbc Andrew Thompson
	if (!$input_errors) {
113
		write_config();
114 f0fe3d30 Scott Ullrich
115 8f9bffbc Andrew Thompson
		$retval = 0;
116
		$retval = services_dnsmasq_configure();
117
		$savemsg = get_std_save_message($retval);
118 5b237745 Scott Ullrich
119 8f9bffbc Andrew Thompson
		// Relaod filter (we might need to sync to CARP hosts)
120
		filter_configure();
121 bd5737dc jim-p
		/* Update resolv.conf in case the interface bindings exclude localhost. */
122
		system_resolvconf_generate();
123 4dbcf2fb Renato Botelho
		/* Start or restart dhcpleases when it's necessary */
124
		system_dhcpleases_configure();
125 020d757a Scott Ullrich
126 8f9bffbc Andrew Thompson
		if ($retval == 0)
127
			clear_subsystem_dirty('hosts');
128
	}
129 5b237745 Scott Ullrich
}
130
131
if ($_GET['act'] == "del") {
132 70edf50d jim-p
	if ($_GET['type'] == 'host') {
133
		if ($a_hosts[$_GET['id']]) {
134
			unset($a_hosts[$_GET['id']]);
135
			write_config();
136 a368a026 Ermal Lu?i
			mark_subsystem_dirty('hosts');
137 70edf50d jim-p
			header("Location: services_dnsmasq.php");
138
			exit;
139
		}
140
	}
141
	elseif ($_GET['type'] == 'doverride') {
142
		if ($a_domainOverrides[$_GET['id']]) {
143
			unset($a_domainOverrides[$_GET['id']]);
144
			write_config();
145 a368a026 Ermal Lu?i
			mark_subsystem_dirty('hosts');
146 70edf50d jim-p
			header("Location: services_dnsmasq.php");
147
			exit;
148
		}
149
	}
150 5b237745 Scott Ullrich
}
151 0c2b5df7 Scott Ullrich
152 7bd5b320 Colin Fleming
$closehead = false;
153 beb2bc00 Rafael Lucas
$pgtitle = array(gettext("Services"),gettext("DNS forwarder"));
154 8f6875de Phil Davis
$shortcut_section = "forwarder";
155 b63695db Scott Ullrich
include("head.inc");
156 0c2b5df7 Scott Ullrich
157 5b237745 Scott Ullrich
?>
158
159 91f026b0 ayvis
<script type="text/javascript">
160 7bd5b320 Colin Fleming
//<![CDATA[
161 6a01ea44 Bill Marquette
function enable_change(enable_over) {
162
	var endis;
163
	endis = !(document.iform.enable.checked || enable_over);
164
	document.iform.regdhcp.disabled = endis;
165
	document.iform.regdhcpstatic.disabled = endis;
166 aa994814 Andrew Thompson
	document.iform.dhcpfirst.disabled = endis;
167 6a01ea44 Bill Marquette
}
168 8f9bffbc Andrew Thompson
function show_advanced_dns() {
169
	document.getElementById("showadvbox").innerHTML='';
170
	aodiv = document.getElementById('showadv');
171
	aodiv.style.display = "block";
172
}
173 7bd5b320 Colin Fleming
//]]>
174 6a01ea44 Bill Marquette
</script>
175 7bd5b320 Colin Fleming
</head>
176 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
177
<?php include("fbegin.inc"); ?>
178 6a01ea44 Bill Marquette
<form action="services_dnsmasq.php" method="post" name="iform" id="iform">
179 8f9bffbc Andrew Thompson
<?php if ($input_errors) print_input_errors($input_errors); ?>
180 5b237745 Scott Ullrich
<?php if ($savemsg) print_info_box($savemsg); ?>
181 7bd5b320 Colin Fleming
<?php if (is_subsystem_dirty('hosts')): ?><br/>
182 8cd558b6 ayvis
<?php print_info_box_np(gettext("The DNS forwarder configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
183 5b237745 Scott Ullrich
<?php endif; ?>
184 7bd5b320 Colin Fleming
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="dns forwarder">
185 70edf50d jim-p
	<tr>
186 6661dbcf jim-p
		<td colspan="2" valign="top" class="listtopic"><?=gettext("General DNS Forwarder Options");?></td>
187
	</tr>
188
	<tr>
189
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Enable");?></td>
190
		<td width="78%" class="vtable"><p>
191 7bd5b320 Colin Fleming
			<input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable'] == "yes") echo "checked=\"checked\"";?> onclick="enable_change(false)" />
192 8cd558b6 ayvis
			<strong><?=gettext("Enable DNS forwarder");?><br />
193 70edf50d jim-p
			</strong></p></td>
194 98776e04 jim-p
		</tr>
195 70edf50d jim-p
	<tr>
196 6661dbcf jim-p
		<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCP Registration");?></td>
197
		<td width="78%" class="vtable"><p>
198 7bd5b320 Colin Fleming
			<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?php if ($pconfig['regdhcp'] == "yes") echo "checked=\"checked\"";?> />
199 8cd558b6 ayvis
			<strong><?=gettext("Register DHCP leases in DNS forwarder");?><br />
200 70edf50d jim-p
			</strong><?php printf(gettext("If this option is set, then machines that specify".
201
			" their hostname when requesting a DHCP lease will be registered".
202
			" in the DNS forwarder, so that their name can be resolved.".
203
			" You should also set the domain in %sSystem:".
204
			" General setup%s to the proper value."),'<a href="system.php">','</a>')?></p>
205
		</td>
206
	</tr>
207
	<tr>
208 6661dbcf jim-p
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Static DHCP");?></td>
209
		<td width="78%" class="vtable"><p>
210 7bd5b320 Colin Fleming
			<input name="regdhcpstatic" type="checkbox" id="regdhcpstatic" value="yes" <?php if ($pconfig['regdhcpstatic'] == "yes") echo "checked=\"checked\"";?> />
211 8cd558b6 ayvis
			<strong><?=gettext("Register DHCP static mappings in DNS forwarder");?><br />
212 70edf50d jim-p
			</strong><?php printf(gettext("If this option is set, then DHCP static mappings will ".
213
					"be registered in the DNS forwarder, so that their name can be ".
214
					"resolved. You should also set the domain in %s".
215
					"System: General setup%s to the proper value."),'<a href="system.php">','</a>');?></p>
216
		</td>
217
	</tr>
218 aa994814 Andrew Thompson
	<tr>
219 6661dbcf jim-p
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Prefer DHCP");?></td>
220
		<td width="78%" class="vtable"><p>
221 7bd5b320 Colin Fleming
			<input name="dhcpfirst" type="checkbox" id="dhcpfirst" value="yes" <?php if ($pconfig['dhcpfirst'] == "yes") echo "checked=\"checked\"";?> />
222 8cd558b6 ayvis
			<strong><?=gettext("Resolve DHCP mappings first");?><br />
223 aa994814 Andrew Thompson
			</strong><?php printf(gettext("If this option is set, then DHCP mappings will ".
224
					"be resolved before the manual list of names below. This only ".
225 649ea752 Andrew Thompson
					"affects the name given for a reverse lookup (PTR)."));?></p>
226 aa994814 Andrew Thompson
		</td>
227
	</tr>
228 96ea7162 N0YB
	<tr>
229 7bdd28fb Phil Davis
		<td rowspan="3" width="22%" valign="top" class="vncellreq"><?=gettext("DNS Query Forwarding");?></td>
230 96ea7162 N0YB
		<td width="78%" class="vtable"><p>
231 7bd5b320 Colin Fleming
			<input name="strict_order" type="checkbox" id="strict_order" value="yes" <?php if ($pconfig['strict_order'] == "yes") echo "checked=\"checked\"";?> />
232 8cd558b6 ayvis
			<strong><?=gettext("Query DNS servers sequentially");?><br />
233 96ea7162 N0YB
			</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
234
					"query the DNS servers sequentially in the order specified (<i>System - General Setup - DNS Servers</i>), ".
235
					"rather than all at once in parallel. ".
236
					""), $g['product_name']); ?></p>
237
		</td>
238
	</tr>
239
	<tr>
240
		<td width="78%" class="vtable"><p>
241 7bd5b320 Colin Fleming
			<input name="domain_needed" type="checkbox" id="domain_needed" value="yes" <?php if ($pconfig['domain_needed'] == "yes") echo "checked=\"checked\"";?> />
242 8cd558b6 ayvis
			<strong><?=gettext("Require domain");?><br />
243 96ea7162 N0YB
			</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
244
					"not forward A or AAAA queries for plain names, without dots or domain parts, to upstream name servers.  ".
245
					"If the name is not known from /etc/hosts or DHCP then a \"not found\" answer is returned. ".
246
					""), $g['product_name']); ?></p>
247
		</td>
248
	</tr>
249 7bdd28fb Phil Davis
	<tr>
250
		<td width="78%" class="vtable"><p>
251 7bd5b320 Colin Fleming
			<input name="no_private_reverse" type="checkbox" id="no_private_reverse" value="yes" <?php if ($pconfig['no_private_reverse'] == "yes") echo "checked=\"checked\"";?> />
252 8cd558b6 ayvis
			<strong><?=gettext("Do not forward private reverse lookups");?><br />
253 7bdd28fb Phil Davis
			</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
254
					"not forward reverse DNS lookups (PTR) for private addresses (RFC 1918) to upstream name servers.  ".
255
					"Any entries in the Domain Overrides section forwarding private \"n.n.n.in-addr.arpa\" names to a specific server are still forwarded. ".
256
					"If the IP to name is not known from /etc/hosts, DHCP or a specific domain override then a \"not found\" answer is immediately returned. ".
257
					""), $g['product_name']); ?></p>
258
		</td>
259
	</tr>
260 e6c49e3d jim-p
	<tr>
261
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td>
262
		<td width="78%" class="vtable"><p>
263 7bd5b320 Colin Fleming
			<input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"{$pconfig['port']}\"";?> />
264 e6c49e3d jim-p
			<br /><br />
265
			<?=gettext("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.");?></p>
266
		</td>
267
	</tr>
268 b4323f39 jim-p
	<tr>
269
		<td width="22%" valign="top" rowspan="2" class="vncellreq"><?=gettext("Interfaces"); ?></td>
270
		<td width="78%" class="vtable">
271
		<?php
272
			$interface_addresses = get_possible_listen_ips(true);
273
			$size=count($interface_addresses)+1;
274
		?>
275 79d03c40 jim-p
			<?=gettext("Interface IPs used by the DNS Forwarder 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.");?>
276 b4323f39 jim-p
			<br /><br />
277 7bd5b320 Colin Fleming
			<select id="interface" name="interface[]" multiple="multiple" class="formselect" size="<?php echo $size; ?>">
278 5c048099 Warren Baker
				<option value="" <?php if (empty($pconfig['interface']) || empty($pconfig['interface'][0])) echo 'selected="selected"'; ?>>All</option>
279 b4323f39 jim-p
			<?php  foreach ($interface_addresses as $laddr):
280
					$selected = "";
281
					if (in_array($laddr['value'], $pconfig['interface']))
282
						$selected = 'selected="selected"';
283
			?>
284
				<option value="<?=$laddr['value'];?>" <?=$selected;?>>
285
					<?=htmlspecialchars($laddr['name']);?>
286
				</option>
287
			<?php endforeach; ?>
288
			</select>
289 79d03c40 jim-p
			<br /><br />
290 b4323f39 jim-p
		</td>
291
	</tr>
292
	<tr>
293
		<td width="78%" class="vtable"><p>
294 7bd5b320 Colin Fleming
			<input name="strictbind" type="checkbox" id="strictbind" value="yes" <?php if ($pconfig['strictbind'] == "yes") echo "checked=\"checked\"";?> />
295 b4323f39 jim-p
			<strong><?=gettext("Strict Interface Binding");?></strong>
296
			<br />
297 79d03c40 jim-p
			<?= gettext("If this option is set, the DNS forwarder will only bind to the interfaces containing the IP addresses selected above, rather than binding to all interfaces and discarding queries to other addresses."); ?>
298 b4323f39 jim-p
			<br /><br />
299
			<?= gettext("NOTE: This option does NOT work with IPv6. If set, dnsmasq will not bind to IPv6 addresses."); ?>
300
			</p>
301
		</td>
302
	</tr>
303 8f9bffbc Andrew Thompson
	<tr>
304 6661dbcf jim-p
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
305 7bd5b320 Colin Fleming
		<td width="78%" class="vtable">
306 8f9bffbc Andrew Thompson
			<div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
307 93fb6094 Colin Fleming
				<input type="button" onclick="show_advanced_dns()" value="<?=gettext("Advanced"); ?>" /> - <?=gettext("Show advanced option");?>
308 8f9bffbc Andrew Thompson
			</div>
309
			<div id="showadv" <?php if (empty($pconfig['custom_options'])) echo "style='display:none'"; ?>>
310 8cd558b6 ayvis
				<strong><?=gettext("Advanced");?><br /></strong>
311
				<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=htmlspecialchars($pconfig['custom_options']);?></textarea><br />
312
				<?=gettext("Enter any additional options you would like to add to the dnsmasq configuration here, separated by a space or newline"); ?><br />
313 8f9bffbc Andrew Thompson
			</div>
314
		</td>
315
	</tr>
316 70edf50d jim-p
	<tr>
317 6661dbcf jim-p
		<td colspan="2">
318 7bd5b320 Colin Fleming
			<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
319 70edf50d jim-p
		</td>
320
	</tr>
321
</table>
322 6661dbcf jim-p
323 8cd558b6 ayvis
<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br />
324 6661dbcf jim-p
</strong></span><?php printf(gettext("If the DNS forwarder is enabled, the DHCP".
325
" service (if enabled) will automatically serve the LAN IP".
326
" address as a DNS server to DHCP clients so they will use".
327
" the forwarder. The DNS forwarder will use the DNS servers".
328
" entered in %sSystem: General setup%s".
329
" or those obtained via DHCP or PPP on WAN if the &quot;Allow".
330
" DNS server list to be overridden by DHCP/PPP on WAN&quot;".
331
" is checked. If you don't use that option (or if you use".
332
" a static IP address on WAN), you must manually specify at".
333
" least one DNS server on the %sSystem:".
334 8cd558b6 ayvis
"General setup%s page."),'<a href="system.php">','</a>','<a href="system.php">','</a>');?><br />
335 6661dbcf jim-p
</span></p>
336
337 8cd558b6 ayvis
&nbsp;<br />
338 7bd5b320 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="host overrides">
339 6661dbcf jim-p
<tr>
340
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Host Overrides");?></td>
341
</tr>
342
<tr>
343 8cd558b6 ayvis
	<td><br />
344 6661dbcf jim-p
	<?=gettext("Entries in this section override individual results from the forwarders.");?>
345
	<?=gettext("Use these for changing DNS results or for adding custom DNS records.");?>
346
	</td>
347
</tr>
348
</table>
349 7bd5b320 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
350 70edf50d jim-p
	<thead>
351
	<tr>
352
		<td width="20%" class="listhdrr"><?=gettext("Host");?></td>
353
		<td width="25%" class="listhdrr"><?=gettext("Domain");?></td>
354
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
355
		<td width="25%" class="listhdr"><?=gettext("Description");?></td>
356
		<td width="10%" class="list">
357 7bd5b320 Colin Fleming
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
358 70edf50d jim-p
				<tr>
359
					<td width="17"></td>
360 7bd5b320 Colin Fleming
					<td valign="middle"><a href="services_dnsmasq_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
361 70edf50d jim-p
				</tr>
362 d415d821 Seth Mos
			</table>
363 70edf50d jim-p
		</td>
364
	</tr>
365
	</thead>
366 7bd5b320 Colin Fleming
	<tfoot>
367
	<tr>
368
		<td class="list" colspan="4"></td>
369
		<td class="list">
370
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
371
				<tr>
372
					<td width="17"></td>
373
					<td valign="middle"><a href="services_dnsmasq_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
374
				</tr>
375
			</table>
376
		</td>
377
	</tr>
378
	</tfoot>
379 70edf50d jim-p
	<tbody>
380
	<?php $i = 0; foreach ($a_hosts as $hostent): ?>
381
	<tr>
382
		<td class="listlr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
383
			<?=strtolower($hostent['host']);?>&nbsp;
384
		</td>
385
		<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
386
			<?=strtolower($hostent['domain']);?>&nbsp;
387
		</td>
388
		<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
389
			<?=$hostent['ip'];?>&nbsp;
390
		</td>
391
		<td class="listbg" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
392
			<?=htmlspecialchars($hostent['descr']);?>&nbsp;
393
		</td>
394 7bd5b320 Colin Fleming
		<td valign="middle" class="list nowrap">
395
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
396 70edf50d jim-p
				<tr>
397 7bd5b320 Colin Fleming
					<td valign="middle"><a href="services_dnsmasq_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td>
398 b3733e10 Colin Fleming
					<td><a href="services_dnsmasq.php?type=host&amp;act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this host?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
399 70edf50d jim-p
				</tr>
400 d415d821 Seth Mos
			</table>
401 70edf50d jim-p
	</tr>
402 e37eeb49 jim-p
	<?php if ($hostent['aliases']['item'] && is_array($hostent['aliases']['item'])): ?>
403 5a2a8349 Lorenz Schori
	<?php foreach ($hostent['aliases']['item'] as $alias): ?>
404
	<tr>
405
		<td class="listlr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
406
			<?=strtolower($alias['host']);?>&nbsp;
407
		</td>
408
		<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
409
			<?=strtolower($alias['domain']);?>&nbsp;
410
		</td>
411
		<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
412
			Alias for <?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain'];?>&nbsp;
413
		</td>
414
		<td class="listbg" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
415
			<?=htmlspecialchars($alias['description']);?>&nbsp;
416
		</td>
417 7bd5b320 Colin Fleming
		<td valign="middle" class="list nowrap">
418
			<a href="services_dnsmasq_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a>
419 5a2a8349 Lorenz Schori
		</td>
420
	</tr>
421
	<?php endforeach; ?>
422 e37eeb49 jim-p
	<?php endif; ?>
423 70edf50d jim-p
	<?php $i++; endforeach; ?>
424 7bd5b320 Colin Fleming
	<tr style="display:none"><td></td></tr>
425 70edf50d jim-p
	</tbody>
426
</table>
427 8cd558b6 ayvis
<br />
428 7bd5b320 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="domain overrides">
429 6661dbcf jim-p
<tr>
430
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Domain Overrides");?></td>
431
</tr>
432
<tr>
433 74127ce3 Finn Espen Gundersen
	<td><p><?=gettext("Entries in this area override an entire domain, and subdomains, by specifying an".
434 7bd5b320 Colin Fleming
	" authoritative DNS server to be queried for that domain.");?></p></td>
435 6661dbcf jim-p
</tr>
436 70edf50d jim-p
</table>
437 7bd5b320 Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
438 70edf50d jim-p
	<thead>
439
	<tr>
440
		<td width="35%" class="listhdrr"><?=gettext("Domain");?></td>
441
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
442
		<td width="35%" class="listhdr"><?=gettext("Description");?></td>
443
		<td width="10%" class="list">
444 7bd5b320 Colin Fleming
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
445 70edf50d jim-p
				<tr>
446 7bd5b320 Colin Fleming
					<td width="17" height="17"></td>
447
					<td><a href="services_dnsmasq_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
448 70edf50d jim-p
				</tr>
449
			</table>
450
		</td>
451
	</tr>
452
	</thead>
453 7bd5b320 Colin Fleming
	<tfoot>
454
	<tr>
455
		<td class="list" colspan="3"></td>
456
		<td class="list">
457
		<table border="0" cellspacing="0" cellpadding="1" summary="add">
458
			<tr>
459
				<td width="17" height="17"></td>
460
				<td><a href="services_dnsmasq_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
461
			</tr>
462
		</table>
463
		</td>
464
	</tr>
465
	</tfoot>
466 70edf50d jim-p
	<tbody>
467
	<?php $i = 0; foreach ($a_domainOverrides as $doment): ?>
468
	<tr>
469
		<td class="listlr">
470
			<?=strtolower($doment['domain']);?>&nbsp;
471
		</td>
472
		<td class="listr">
473
			<?=$doment['ip'];?>&nbsp;
474
		</td>
475
		<td class="listbg">
476
			<?=htmlspecialchars($doment['descr']);?>&nbsp;
477
		</td>
478 7bd5b320 Colin Fleming
		<td valign="middle" class="list nowrap"> <a href="services_dnsmasq_domainoverride_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a>
479 b3733e10 Colin Fleming
			&nbsp;<a href="services_dnsmasq.php?act=del&amp;type=doverride&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this domain override?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
480 70edf50d jim-p
	</tr>
481
	<?php $i++; endforeach; ?>
482 7bd5b320 Colin Fleming
	<tr style="display:none"><td></td></tr>
483 70edf50d jim-p
	</tbody>
484
</table>
485
</form>
486 91f026b0 ayvis
<script type="text/javascript">
487 7bd5b320 Colin Fleming
//<![CDATA[
488 6a01ea44 Bill Marquette
enable_change(false);
489 7bd5b320 Colin Fleming
//]]>
490 6a01ea44 Bill Marquette
</script>
491 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>
492
</body>
493
</html>