Project

General

Profile

Download (21.6 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	services_dnsmasq.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2003-2004 Bob Zoller <bob@kludgebox.com> and Manuel Kasper <mk@neon1.net>.
8
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
9
	All rights reserved.
10

    
11
	Redistribution and use in source and binary forms, with or without
12
	modification, are permitted provided that the following conditions are met:
13

    
14
	1. Redistributions of source code must retain the above copyright notice,
15
	   this list of conditions and the following disclaimer.
16

    
17
	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

    
21
	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
/*
33
	pfSense_MODULE:	dnsforwarder
34
*/
35

    
36
##|+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
require("guiconfig.inc");
44
require_once("functions.inc");
45
require_once("filter.inc");
46
require_once("shaper.inc");
47
require_once("system.inc");
48

    
49
$pconfig['enable'] = isset($config['dnsmasq']['enable']);
50
$pconfig['regdhcp'] = isset($config['dnsmasq']['regdhcp']);
51
$pconfig['regdhcpstatic'] = isset($config['dnsmasq']['regdhcpstatic']);
52
$pconfig['dhcpfirst'] = isset($config['dnsmasq']['dhcpfirst']);
53
$pconfig['strict_order'] = isset($config['dnsmasq']['strict_order']);
54
$pconfig['domain_needed'] = isset($config['dnsmasq']['domain_needed']);
55
$pconfig['no_private_reverse'] = isset($config['dnsmasq']['no_private_reverse']);
56
$pconfig['port'] = $config['dnsmasq']['port'];
57
$pconfig['custom_options'] = $config['dnsmasq']['custom_options'];
58

    
59
$pconfig['strictbind'] = isset($config['dnsmasq']['strictbind']);
60
if (!empty($config['dnsmasq']['interface']))
61
	$pconfig['interface'] = explode(",", $config['dnsmasq']['interface']);
62
else
63
	$pconfig['interface'] = array();
64

    
65
if (!is_array($config['dnsmasq']['hosts']))
66
	$config['dnsmasq']['hosts'] = array();
67

    
68
if (!is_array($config['dnsmasq']['domainoverrides']))
69
	$config['dnsmasq']['domainoverrides'] = array();
70

    
71

    
72
$a_hosts = &$config['dnsmasq']['hosts'];
73
$a_domainOverrides = &$config['dnsmasq']['domainoverrides'];
74

    
75
if ($_POST) {
76

    
77
	$pconfig = $_POST;
78
	unset($input_errors);
79

    
80
	$config['dnsmasq']['enable'] = ($_POST['enable']) ? true : false;
81
	$config['dnsmasq']['regdhcp'] = ($_POST['regdhcp']) ? true : false;
82
	$config['dnsmasq']['regdhcpstatic'] = ($_POST['regdhcpstatic']) ? true : false;
83
	$config['dnsmasq']['dhcpfirst'] = ($_POST['dhcpfirst']) ? true : false;
84
	$config['dnsmasq']['strict_order'] = ($_POST['strict_order']) ? true : false;
85
	$config['dnsmasq']['domain_needed'] = ($_POST['domain_needed']) ? true : false;
86
	$config['dnsmasq']['no_private_reverse'] = ($_POST['no_private_reverse']) ? true : false;
87
	$config['dnsmasq']['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
88
	$config['dnsmasq']['strictbind'] = ($_POST['strictbind']) ? true : false;
89

    
90
	if (isset($_POST['enable']) && isset($config['unbound']['enable'])) {
91
		if ($_POST['port'] == $config['unbound']['port'])
92
			$input_errors[] = "The DNS Resolver is enabled using this port. Choose a non-conflicting port, or disable DNS Resolver.";
93
	}
94
	
95
	if ($_POST['port'])
96
		if(is_port($_POST['port']))
97
			$config['dnsmasq']['port'] = $_POST['port'];
98
		else
99
			$input_errors[] = gettext("You must specify a valid port number");
100
	else if (isset($config['dnsmasq']['port']))
101
		unset($config['dnsmasq']['port']);
102

    
103
	if (is_array($_POST['interface']))
104
		$config['dnsmasq']['interface'] = implode(",", $_POST['interface']);
105
	elseif (isset($config['dnsmasq']['interface']))
106
		unset($config['dnsmasq']['interface']);
107

    
108
	if ($config['dnsmasq']['custom_options']) {
109
		$args = '';
110
		foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c)
111
			$args .= escapeshellarg("--{$c}") . " ";
112
		exec("/usr/local/sbin/dnsmasq --test $args", $output, $rc);
113
		if ($rc != 0)
114
			$input_errors[] = gettext("Invalid custom options");
115
	}
116

    
117
	if (!$input_errors) {
118
		write_config();
119

    
120
		$retval = 0;
121
		$retval = services_dnsmasq_configure();
122
		$savemsg = get_std_save_message($retval);
123

    
124
		// Relaod filter (we might need to sync to CARP hosts)
125
		filter_configure();
126
		/* Update resolv.conf in case the interface bindings exclude localhost. */
127
		system_resolvconf_generate();
128
		/* Start or restart dhcpleases when it's necessary */
129
		system_dhcpleases_configure();
130

    
131
		if ($retval == 0)
132
			clear_subsystem_dirty('hosts');
133
	}
134
}
135

    
136
if ($_GET['act'] == "del") {
137
	if ($_GET['type'] == 'host') {
138
		if ($a_hosts[$_GET['id']]) {
139
			unset($a_hosts[$_GET['id']]);
140
			write_config();
141
			mark_subsystem_dirty('hosts');
142
			header("Location: services_dnsmasq.php");
143
			exit;
144
		}
145
	}
146
	elseif ($_GET['type'] == 'doverride') {
147
		if ($a_domainOverrides[$_GET['id']]) {
148
			unset($a_domainOverrides[$_GET['id']]);
149
			write_config();
150
			mark_subsystem_dirty('hosts');
151
			header("Location: services_dnsmasq.php");
152
			exit;
153
		}
154
	}
155
}
156

    
157
$closehead = false;
158
$pgtitle = array(gettext("Services"),gettext("DNS forwarder"));
159
$shortcut_section = "forwarder";
160
include("head.inc");
161

    
162
?>
163

    
164
<script type="text/javascript">
165
//<![CDATA[
166
function enable_change(enable_over) {
167
	var endis;
168
	endis = !(document.iform.enable.checked || enable_over);
169
	document.iform.regdhcp.disabled = endis;
170
	document.iform.regdhcpstatic.disabled = endis;
171
	document.iform.dhcpfirst.disabled = endis;
172
}
173
function show_advanced_dns() {
174
	document.getElementById("showadvbox").innerHTML='';
175
	aodiv = document.getElementById('showadv');
176
	aodiv.style.display = "block";
177
}
178
//]]>
179
</script>
180
</head>
181
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
182
<?php include("fbegin.inc"); ?>
183
<form action="services_dnsmasq.php" method="post" name="iform" id="iform">
184
<?php if ($input_errors) print_input_errors($input_errors); ?>
185
<?php if ($savemsg) print_info_box($savemsg); ?>
186
<?php if (is_subsystem_dirty('hosts')): ?><br/>
187
<?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 />
188
<?php endif; ?>
189
<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="dns forwarder">
190
	<tr>
191
		<td colspan="2" valign="top" class="listtopic"><?=gettext("General DNS Forwarder Options");?></td>
192
	</tr>
193
	<tr>
194
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Enable");?></td>
195
		<td width="78%" class="vtable"><p>
196
			<input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable'] == "yes") echo "checked=\"checked\"";?> onclick="enable_change(false)" />
197
			<strong><?=gettext("Enable DNS forwarder");?><br />
198
			</strong></p></td>
199
		</tr>
200
	<tr>
201
		<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCP Registration");?></td>
202
		<td width="78%" class="vtable"><p>
203
			<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?php if ($pconfig['regdhcp'] == "yes") echo "checked=\"checked\"";?> />
204
			<strong><?=gettext("Register DHCP leases in DNS forwarder");?><br />
205
			</strong><?php printf(gettext("If this option is set, then machines that specify".
206
			" their hostname when requesting a DHCP lease will be registered".
207
			" in the DNS forwarder, so that their name can be resolved.".
208
			" You should also set the domain in %sSystem:".
209
			" General setup%s to the proper value."),'<a href="system.php">','</a>')?></p>
210
		</td>
211
	</tr>
212
	<tr>
213
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Static DHCP");?></td>
214
		<td width="78%" class="vtable"><p>
215
			<input name="regdhcpstatic" type="checkbox" id="regdhcpstatic" value="yes" <?php if ($pconfig['regdhcpstatic'] == "yes") echo "checked=\"checked\"";?> />
216
			<strong><?=gettext("Register DHCP static mappings in DNS forwarder");?><br />
217
			</strong><?php printf(gettext("If this option is set, then DHCP static mappings will ".
218
					"be registered in the DNS forwarder, so that their name can be ".
219
					"resolved. You should also set the domain in %s".
220
					"System: General setup%s to the proper value."),'<a href="system.php">','</a>');?></p>
221
		</td>
222
	</tr>
223
	<tr>
224
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Prefer DHCP");?></td>
225
		<td width="78%" class="vtable"><p>
226
			<input name="dhcpfirst" type="checkbox" id="dhcpfirst" value="yes" <?php if ($pconfig['dhcpfirst'] == "yes") echo "checked=\"checked\"";?> />
227
			<strong><?=gettext("Resolve DHCP mappings first");?><br />
228
			</strong><?php printf(gettext("If this option is set, then DHCP mappings will ".
229
					"be resolved before the manual list of names below. This only ".
230
					"affects the name given for a reverse lookup (PTR)."));?></p>
231
		</td>
232
	</tr>
233
	<tr>
234
		<td rowspan="3" width="22%" valign="top" class="vncellreq"><?=gettext("DNS Query Forwarding");?></td>
235
		<td width="78%" class="vtable"><p>
236
			<input name="strict_order" type="checkbox" id="strict_order" value="yes" <?php if ($pconfig['strict_order'] == "yes") echo "checked=\"checked\"";?> />
237
			<strong><?=gettext("Query DNS servers sequentially");?><br />
238
			</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
239
					"query the DNS servers sequentially in the order specified (<i>System - General Setup - DNS Servers</i>), ".
240
					"rather than all at once in parallel. ".
241
					""), $g['product_name']); ?></p>
242
		</td>
243
	</tr>
244
	<tr>
245
		<td width="78%" class="vtable"><p>
246
			<input name="domain_needed" type="checkbox" id="domain_needed" value="yes" <?php if ($pconfig['domain_needed'] == "yes") echo "checked=\"checked\"";?> />
247
			<strong><?=gettext("Require domain");?><br />
248
			</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
249
					"not forward A or AAAA queries for plain names, without dots or domain parts, to upstream name servers.  ".
250
					"If the name is not known from /etc/hosts or DHCP then a \"not found\" answer is returned. ".
251
					""), $g['product_name']); ?></p>
252
		</td>
253
	</tr>
254
	<tr>
255
		<td width="78%" class="vtable"><p>
256
			<input name="no_private_reverse" type="checkbox" id="no_private_reverse" value="yes" <?php if ($pconfig['no_private_reverse'] == "yes") echo "checked=\"checked\"";?> />
257
			<strong><?=gettext("Do not forward private reverse lookups");?><br />
258
			</strong><?php printf(gettext("If this option is set, %s DNS Forwarder (dnsmasq) will ".
259
					"not forward reverse DNS lookups (PTR) for private addresses (RFC 1918) to upstream name servers.  ".
260
					"Any entries in the Domain Overrides section forwarding private \"n.n.n.in-addr.arpa\" names to a specific server are still forwarded. ".
261
					"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. ".
262
					""), $g['product_name']); ?></p>
263
		</td>
264
	</tr>
265
	<tr>
266
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td>
267
		<td width="78%" class="vtable"><p>
268
			<input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"" . htmlspecialchars($pconfig['port']) . "\"";?> />
269
			<br /><br />
270
			<?=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>
271
		</td>
272
	</tr>
273
	<tr>
274
		<td width="22%" valign="top" rowspan="2" class="vncellreq"><?=gettext("Interfaces"); ?></td>
275
		<td width="78%" class="vtable">
276
		<?php
277
			$interface_addresses = get_possible_listen_ips(true);
278
			$size=count($interface_addresses)+1;
279
		?>
280
			<?=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.");?>
281
			<br /><br />
282
			<select id="interface" name="interface[]" multiple="multiple" class="formselect" size="<?php echo $size; ?>">
283
				<option value="" <?php if (empty($pconfig['interface']) || empty($pconfig['interface'][0])) echo 'selected="selected"'; ?>>All</option>
284
			<?php  foreach ($interface_addresses as $laddr):
285
					$selected = "";
286
					if (in_array($laddr['value'], $pconfig['interface']))
287
						$selected = 'selected="selected"';
288
			?>
289
				<option value="<?=$laddr['value'];?>" <?=$selected;?>>
290
					<?=htmlspecialchars($laddr['name']);?>
291
				</option>
292
			<?php endforeach; ?>
293
			</select>
294
			<br /><br />
295
		</td>
296
	</tr>
297
	<tr>
298
		<td width="78%" class="vtable"><p>
299
			<input name="strictbind" type="checkbox" id="strictbind" value="yes" <?php if ($pconfig['strictbind'] == "yes") echo "checked=\"checked\"";?> />
300
			<strong><?=gettext("Strict Interface Binding");?></strong>
301
			<br />
302
			<?= 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."); ?>
303
			<br /><br />
304
			<?= gettext("NOTE: This option does NOT work with IPv6. If set, dnsmasq will not bind to IPv6 addresses."); ?>
305
			</p>
306
		</td>
307
	</tr>
308
	<tr>
309
		<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
310
		<td width="78%" class="vtable">
311
			<div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
312
				<input type="button" onclick="show_advanced_dns()" value="<?=gettext("Advanced"); ?>" /> - <?=gettext("Show advanced option");?>
313
			</div>
314
			<div id="showadv" <?php if (empty($pconfig['custom_options'])) echo "style='display:none'"; ?>>
315
				<strong><?=gettext("Advanced");?><br /></strong>
316
				<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=htmlspecialchars($pconfig['custom_options']);?></textarea><br />
317
				<?=gettext("Enter any additional options you would like to add to the dnsmasq configuration here, separated by a space or newline"); ?><br />
318
			</div>
319
		</td>
320
	</tr>
321
	<tr>
322
		<td colspan="2">
323
			<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
324
		</td>
325
	</tr>
326
</table>
327

    
328
<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br />
329
</strong></span><?php printf(gettext("If the DNS forwarder is enabled, the DHCP".
330
" service (if enabled) will automatically serve the LAN IP".
331
" address as a DNS server to DHCP clients so they will use".
332
" the forwarder. The DNS forwarder will use the DNS servers".
333
" entered in %sSystem: General setup%s".
334
" or those obtained via DHCP or PPP on WAN if the &quot;Allow".
335
" DNS server list to be overridden by DHCP/PPP on WAN&quot;".
336
" is checked. If you don't use that option (or if you use".
337
" a static IP address on WAN), you must manually specify at".
338
" least one DNS server on the %sSystem:".
339
"General setup%s page."),'<a href="system.php">','</a>','<a href="system.php">','</a>');?><br />
340
</span></p>
341

    
342
&nbsp;<br />
343
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="host overrides">
344
<tr>
345
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Host Overrides");?></td>
346
</tr>
347
<tr>
348
	<td><br />
349
	<?=gettext("Entries in this section override individual results from the forwarders.");?>
350
	<?=gettext("Use these for changing DNS results or for adding custom DNS records.");?>
351
	</td>
352
</tr>
353
</table>
354
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
355
	<thead>
356
	<tr>
357
		<td width="20%" class="listhdrr"><?=gettext("Host");?></td>
358
		<td width="25%" class="listhdrr"><?=gettext("Domain");?></td>
359
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
360
		<td width="25%" class="listhdr"><?=gettext("Description");?></td>
361
		<td width="10%" class="list">
362
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
363
				<tr>
364
					<td width="17"></td>
365
					<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>
366
				</tr>
367
			</table>
368
		</td>
369
	</tr>
370
	</thead>
371
	<tfoot>
372
	<tr>
373
		<td class="list" colspan="4"></td>
374
		<td class="list">
375
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
376
				<tr>
377
					<td width="17"></td>
378
					<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>
379
				</tr>
380
			</table>
381
		</td>
382
	</tr>
383
	</tfoot>
384
	<tbody>
385
	<?php $i = 0; foreach ($a_hosts as $hostent): ?>
386
	<tr>
387
		<td class="listlr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
388
			<?=strtolower($hostent['host']);?>&nbsp;
389
		</td>
390
		<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
391
			<?=strtolower($hostent['domain']);?>&nbsp;
392
		</td>
393
		<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
394
			<?=$hostent['ip'];?>&nbsp;
395
		</td>
396
		<td class="listbg" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
397
			<?=htmlspecialchars($hostent['descr']);?>&nbsp;
398
		</td>
399
		<td valign="middle" class="list nowrap">
400
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
401
				<tr>
402
					<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>
403
					<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>
404
				</tr>
405
			</table>
406
		</td>
407
	</tr>
408
	<?php if ($hostent['aliases']['item'] && is_array($hostent['aliases']['item'])): ?>
409
	<?php foreach ($hostent['aliases']['item'] as $alias): ?>
410
	<tr>
411
		<td class="listlr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
412
			<?=strtolower($alias['host']);?>&nbsp;
413
		</td>
414
		<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
415
			<?=strtolower($alias['domain']);?>&nbsp;
416
		</td>
417
		<td class="listr" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
418
			Alias for <?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain'];?>&nbsp;
419
		</td>
420
		<td class="listbg" ondblclick="document.location='services_dnsmasq_edit.php?id=<?=$i;?>';">
421
			<?=htmlspecialchars($alias['description']);?>&nbsp;
422
		</td>
423
		<td valign="middle" class="list nowrap">
424
			<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>
425
		</td>
426
	</tr>
427
	<?php endforeach; ?>
428
	<?php endif; ?>
429
	<?php $i++; endforeach; ?>
430
	<tr style="display:none"><td></td></tr>
431
	</tbody>
432
</table>
433
<br />
434
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="domain overrides">
435
<tr>
436
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Domain Overrides");?></td>
437
</tr>
438
<tr>
439
	<td><p><?=gettext("Entries in this area override an entire domain, and subdomains, by specifying an".
440
	" authoritative DNS server to be queried for that domain.");?></p></td>
441
</tr>
442
</table>
443
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
444
	<thead>
445
	<tr>
446
		<td width="35%" class="listhdrr"><?=gettext("Domain");?></td>
447
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
448
		<td width="35%" class="listhdr"><?=gettext("Description");?></td>
449
		<td width="10%" class="list">
450
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
451
				<tr>
452
					<td width="17" height="17"></td>
453
					<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>
454
				</tr>
455
			</table>
456
		</td>
457
	</tr>
458
	</thead>
459
	<tfoot>
460
	<tr>
461
		<td class="list" colspan="3"></td>
462
		<td class="list">
463
		<table border="0" cellspacing="0" cellpadding="1" summary="add">
464
			<tr>
465
				<td width="17" height="17"></td>
466
				<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>
467
			</tr>
468
		</table>
469
		</td>
470
	</tr>
471
	</tfoot>
472
	<tbody>
473
	<?php $i = 0; foreach ($a_domainOverrides as $doment): ?>
474
	<tr>
475
		<td class="listlr">
476
			<?=strtolower($doment['domain']);?>&nbsp;
477
		</td>
478
		<td class="listr">
479
			<?=$doment['ip'];?>&nbsp;
480
		</td>
481
		<td class="listbg">
482
			<?=htmlspecialchars($doment['descr']);?>&nbsp;
483
		</td>
484
		<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>
485
			&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>
486
	</tr>
487
	<?php $i++; endforeach; ?>
488
	<tr style="display:none"><td></td></tr>
489
	</tbody>
490
</table>
491
</form>
492
<script type="text/javascript">
493
//<![CDATA[
494
enable_change(false);
495
//]]>
496
</script>
497
<?php include("fend.inc"); ?>
498
</body>
499
</html>
(156-156/256)