Project

General

Profile

Download (22.8 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	services_unbound.php
5
	part of the pfSense project (https://www.pfsense.org)
6
	Copyright (C) 2014	Warren Baker (warren@pfsense.org)
7
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
8
	All rights reserved.
9

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

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

    
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19

    
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
/*
32
	pfSense_MODULE:	dnsresolver
33
*/
34

    
35
##|+PRIV
36
##|*IDENT=page-services-unbound
37
##|*NAME=Services: DNS Resolver page
38
##|*DESCR=Allow access to the 'Services: DNS Resolver' page.
39
##|*MATCH=services_unbound.php*
40
##|-PRIV
41

    
42
require_once("guiconfig.inc");
43
require_once("unbound.inc");
44
require_once("system.inc");
45

    
46
if (!is_array($config['unbound'])) {
47
	$config['unbound'] = array();
48
}
49

    
50
$a_unboundcfg =& $config['unbound'];
51

    
52
if (!is_array($config['unbound']['hosts'])) {
53
	$config['unbound']['hosts'] = array();
54
}
55

    
56
$a_hosts =& $config['unbound']['hosts'];
57

    
58
if (!is_array($config['unbound']['domainoverrides'])) {
59
	$config['unbound']['domainoverrides'] = array();
60
}
61

    
62
$a_domainOverrides = &$config['unbound']['domainoverrides'];
63

    
64
if (isset($config['unbound']['enable'])) {
65
	$pconfig['enable'] = true;
66
}
67
if (isset($config['unbound']['dnssec'])) {
68
	$pconfig['dnssec'] = true;
69
}
70
if (isset($config['unbound']['forwarding'])) {
71
	$pconfig['forwarding'] = true;
72
}
73
if (isset($config['unbound']['regdhcp'])) {
74
	$pconfig['regdhcp'] = true;
75
}
76
if (isset($config['unbound']['regdhcpstatic'])) {
77
	$pconfig['regdhcpstatic'] = true;
78
}
79
if (isset($config['unbound']['txtsupport'])) {
80
	$pconfig['txtsupport'] = true;
81
}
82

    
83
$pconfig['port'] = $config['unbound']['port'];
84
$pconfig['custom_options'] = base64_decode($config['unbound']['custom_options']);
85

    
86
if (empty($config['unbound']['active_interface'])) {
87
	$pconfig['active_interface'] = array();
88
} else {
89
	$pconfig['active_interface'] = explode(",", $config['unbound']['active_interface']);
90
}
91
if (empty($config['unbound']['outgoing_interface'])) {
92
	$pconfig['outgoing_interface'] = array();
93
} else {
94
	$pconfig['outgoing_interface'] = explode(",", $config['unbound']['outgoing_interface']);
95
}
96

    
97
if ($_POST) {
98
	$pconfig = $_POST;
99
	unset($input_errors);
100

    
101
	if ($_POST['apply']) {
102
		$retval = services_unbound_configure();
103
		$savemsg = get_std_save_message($retval);
104
		if ($retval == 0) {
105
			clear_subsystem_dirty('unbound');
106
		}
107
		/* Update resolv.conf in case the interface bindings exclude localhost. */
108
		system_resolvconf_generate();
109
		/* Start or restart dhcpleases when it's necessary */
110
		system_dhcpleases_configure();
111
	} else {
112
		if (isset($_POST['enable']) && isset($config['dnsmasq']['enable'])) {
113
			if ($_POST['port'] == $config['dnsmasq']['port'])
114
				$input_errors[] = "The DNS Forwarder is enabled using this port. Choose a non-conflicting port, or disable the DNS Forwarder.";
115
		}
116

    
117
		if (empty($_POST['active_interface'])) {
118
			$input_errors[] = "One or more Network Interfaces must be selected for binding.";
119
		} else if (!isset($config['system']['dnslocalhost']) && (!in_array("lo0", $_POST['active_interface']) && !in_array("all", $_POST['active_interface']))) {
120
			$input_errors[] = "This system is configured to use the DNS Resolver as its DNS server, so Localhost or All must be selected in Network Interfaces.";
121
		}
122

    
123
		if (empty($_POST['outgoing_interface'])) {
124
			$input_errors[] = "One or more Outgoing Network Interfaces must be selected.";
125
		}
126

    
127
		if ($_POST['port']) {
128
			if (is_port($_POST['port'])) {
129
				$a_unboundcfg['port'] = $_POST['port'];
130
			} else {
131
				$input_errors[] = gettext("You must specify a valid port number.");
132
			}
133
		} else if (isset($config['unbound']['port'])) {
134
			unset($config['unbound']['port']);
135
		}
136

    
137
		if (isset($_POST['enable'])) {
138
			$a_unboundcfg['enable'] = true;
139
		} else {
140
			unset($a_unboundcfg['enable']);
141
		}
142
		if (isset($_POST['dnssec'])) {
143
			$a_unboundcfg['dnssec'] = true;
144
		} else {
145
			unset($a_unboundcfg['dnssec']);
146
		}
147
		if (isset($_POST['forwarding'])) {
148
			$a_unboundcfg['forwarding'] = true;
149
		} else {
150
			unset($a_unboundcfg['forwarding']);
151
		}
152
		if (isset($_POST['regdhcp'])) {
153
			$a_unboundcfg['regdhcp'] = true;
154
		} else {
155
			unset($a_unboundcfg['regdhcp']);
156
		}
157
		if (isset($_POST['regdhcpstatic'])) {
158
			$a_unboundcfg['regdhcpstatic'] = true;
159
		} else {
160
			unset($a_unboundcfg['regdhcpstatic']);
161
		}
162
		if (isset($_POST['txtsupport'])) {
163
			$a_unboundcfg['txtsupport'] = true;
164
		} else {
165
			unset($a_unboundcfg['txtsupport']);
166
		}
167
		if (is_array($_POST['active_interface']) && !empty($_POST['active_interface'])) {
168
			$a_unboundcfg['active_interface'] = implode(",", $_POST['active_interface']);
169
		}
170

    
171
		if (is_array($_POST['outgoing_interface']) && !empty($_POST['outgoing_interface'])) {
172
			$a_unboundcfg['outgoing_interface'] = implode(",", $_POST['outgoing_interface']);
173
		}
174

    
175
		$a_unboundcfg['custom_options'] = base64_encode(str_replace("\r\n", "\n", $_POST['custom_options']));
176

    
177
		if (!$input_errors) {
178
			write_config("DNS Resolver configured.");
179
			mark_subsystem_dirty('unbound');
180
		}
181
	}
182
}
183

    
184
if ($_GET['act'] == "del") {
185
	if ($_GET['type'] == 'host') {
186
		if ($a_hosts[$_GET['id']]) {
187
			unset($a_hosts[$_GET['id']]);
188
			write_config();
189
			mark_subsystem_dirty('unbound');
190
			header("Location: services_unbound.php");
191
			exit;
192
		}
193
	} elseif ($_GET['type'] == 'doverride') {
194
		if ($a_domainOverrides[$_GET['id']]) {
195
			unset($a_domainOverrides[$_GET['id']]);
196
			write_config();
197
			mark_subsystem_dirty('unbound');
198
			header("Location: services_unbound.php");
199
			exit;
200
		}
201
	}
202
}
203

    
204
$closehead = false;
205
$pgtitle = array(gettext("Services"),gettext("DNS Resolver"));
206
$shortcut_section = "resolver";
207
include_once("head.inc");
208

    
209
?>
210

    
211
<script type="text/javascript">
212
//<![CDATA[
213
function enable_change(enable_over) {
214
	var endis;
215
	endis = !(jQuery('#enable').is(":checked") || enable_over);
216
	jQuery("#active_interface,#outgoing_interface,#dnssec,#forwarding,#regdhcp,#regdhcpstatic,#dhcpfirst,#port,#txtsupport,#custom_options").prop('disabled', endis);
217
}
218
function show_advanced_dns() {
219
	jQuery("#showadv").show();
220
	jQuery("#showadvbox").hide();
221
}
222
//]]>
223
</script>
224
</head>
225

    
226
<body>
227
<?php include("fbegin.inc"); ?>
228
<form action="services_unbound.php" method="post" name="iform" id="iform">
229
<?php if ($input_errors) print_input_errors($input_errors); ?>
230
<?php if ($savemsg) print_info_box($savemsg); ?>
231
<?php if (is_subsystem_dirty('unbound')): ?><br/>
232
<?php print_info_box_np(gettext("The configuration of the DNS Resolver has been changed") . ".<br />" . gettext("You must apply changes for them to take effect."));?><br />
233
<?php endif; ?>
234
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="services unbound">
235
	<tbody>
236
		<tr>
237
			<td class="tabnavtbl">
238
				<?php
239
					$tab_array = array();
240
					$tab_array[] = array(gettext("General settings"), true, "services_unbound.php");
241
					$tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php");
242
					$tab_array[] = array(gettext("Access Lists"), false, "/services_unbound_acls.php");
243
					display_top_tabs($tab_array, true);
244
				?>
245
			</td>
246
		</tr>
247
		<tr>
248
			<td id="mainarea">
249
				<div class="tabcont">
250
					<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
251
						<tbody>
252
							<tr>
253
								<td colspan="2" valign="top" class="listtopic"><?=gettext("General DNS Resolver Options");?></td>
254
							</tr>
255
							<tr>
256
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Enable");?></td>
257
								<td width="78%" class="vtable"><p>
258
									<input name="enable" type="checkbox" id="enable" value="yes" <?php if (isset($pconfig['enable'])) echo "checked=\"checked\"";?> onclick="enable_change(false)" />
259
									<strong><?=gettext("Enable DNS Resolver");?><br />
260
									</strong></p>
261
								</td>
262
							</tr>
263
							<tr>
264
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td>
265
								<td width="78%" class="vtable">
266
									<p>
267
										<input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"{$pconfig['port']}\"";?> />
268
										<br /><br />
269
										<?=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.");?>
270
									</p>
271
								</td>
272
							</tr>
273
							<tr>
274
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Network Interfaces"); ?></td>
275
								<td width="78%" class="vtable">
276
								<?php
277
									$interface_addresses = get_possible_listen_ips(true);
278
								?>
279
									<?=gettext("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.");?>
280
									<br /><br />
281
									<select id="active_interface" name="active_interface[]" multiple="multiple" size="<?php echo $size; ?>">
282
										<option value="all" <?php if (empty($pconfig['active_interface']) || empty($pconfig['active_interface'][0]) || in_array("all", $pconfig['active_interface'], true)) echo 'selected="selected"'; ?>>All</option>
283
										<?php
284
											foreach ($interface_addresses as $laddr => $ldescr):
285
												$selected = "";
286
												if (in_array($laddr, $pconfig['active_interface']))
287
													$selected = 'selected="selected"';
288
										?>
289
										<option value="<?=$laddr;?>" <?=$selected;?>>
290
											<?=htmlspecialchars($ldescr);?>
291
										</option>
292
										<?php endforeach; ?>
293
									</select>
294
									<br /><br />
295
								</td>
296
							</tr>
297
							<tr>
298
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Outgoing Network Interfaces"); ?></td>
299
								<td width="78%" class="vtable">
300
									<?=gettext("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.");?>
301
									<br /><br />
302
									<select id="outgoing_interface" name="outgoing_interface[]" multiple="multiple" size="<?php echo $size; ?>">
303
										<option value="" <?php if (empty($pconfig['outgoing_interface']) || empty($pconfig['outgoing_interface'][0])) echo 'selected="selected"'; ?>>All</option>
304
										<?php
305
											foreach ($interface_addresses as $laddr => $ldescr):
306
												$selected = "";
307
												if (in_array($laddr, $pconfig['outgoing_interface']))
308
												$selected = 'selected="selected"';
309
										?>
310
										<option value="<?=$laddr;?>" <?=$selected;?>>
311
											<?=htmlspecialchars($ldescr);?>
312
										</option>
313
										<?php endforeach;
314
							   unset($interface_addresses);
315
										?>
316
									</select>
317
									<br /><br />
318
								</td>
319
							</tr>
320
							<tr>
321
								<td width="22%" valign="top" class="vncellreq"><?=gettext("DNSSEC");?></td>
322
								<td width="78%" class="vtable"><p>
323
									<input name="dnssec" type="checkbox" id="dnssec" value="yes" <?php echo (isset($pconfig['dnssec']) ? "checked=\"checked\"" : "");?> />
324
									<strong><?=gettext("Enable DNSSEC Support");?><br />
325
									</strong></p>
326
								</td>
327
							</tr>
328
							<tr>
329
								<td width="22%" valign="top" class="vncellreq"><?=gettext("DNS Query Forwarding");?></td>
330
								<td width="78%" class="vtable"><p>
331
									<input name="forwarding" type="checkbox" id="forwarding" value="yes" <?php echo (isset($pconfig['forwarding']) ? "checked=\"checked\"" : "");?> />
332
									<strong><?=gettext("Enable Forwarding Mode");?></strong><br /></p>
333
								</td>
334
							</tr>
335
							<tr>
336
								<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCP Registration");?></td>
337
								<td width="78%" class="vtable"><p>
338
									<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?php if (isset($pconfig['regdhcp'])) echo "checked=\"checked\"";?> />
339
									<strong><?=gettext("Register DHCP leases in the DNS Resolver");?><br />
340
									</strong><?php printf(gettext("If this option is set, then machines that specify".
341
									" their hostname when requesting a DHCP lease will be registered".
342
									" in the DNS Resolver, so that their name can be resolved.".
343
									" You should also set the domain in %sSystem:".
344
									" General setup%s to the proper value."),'<a href="system.php">','</a>')?></p>
345
								</td>
346
							</tr>
347
							<tr>
348
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Static DHCP");?></td>
349
								<td width="78%" class="vtable"><p>
350
									<input name="regdhcpstatic" type="checkbox" id="regdhcpstatic" value="yes" <?php if (isset($pconfig['regdhcpstatic'])) echo "checked=\"checked\"";?> />
351
									<strong><?=gettext("Register DHCP static mappings in the DNS Resolver");?><br />
352
									</strong><?php printf(gettext("If this option is set, then DHCP static mappings will ".
353
											"be registered in the DNS Resolver, so that their name can be ".
354
											"resolved. You should also set the domain in %s".
355
											"System: General setup%s to the proper value."),'<a href="system.php">','</a>');?></p>
356
								</td>
357
							</tr>
358
							<tr>
359
								<td width="22%" valign="top" class="vncellreq"><?=gettext("TXT Comment Support");?></td>
360
								<td width="78%" class="vtable"><p>
361
									<input name="txtsupport" type="checkbox" id="txtsupport" value="yes" <?php echo (isset($pconfig['txtsupport']) ? "checked=\"checked\"" : "");?> />
362
									<strong><?=gettext("If this option is set, then any descriptions associated with Host entries and DHCP Static mappings will create a corresponding TXT record.");?><br />
363
									</strong></p>
364
								</td>
365
							</tr>
366
							<tr>
367
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
368
								<td width="78%" class="vtable">
369
									<div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
370
										<input type="button" onclick="show_advanced_dns()" value="<?=gettext("Advanced"); ?>" /> - <?=gettext("Show advanced option");?>
371
									</div>
372
									<div id="showadv" <?php if (empty($pconfig['custom_options'])) echo "style='display:none'"; ?>>
373
										<strong><?=gettext("Advanced");?><br /></strong>
374
										<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=htmlspecialchars($pconfig['custom_options']);?></textarea><br />
375
										<?=gettext("Enter any additional configuration parameters to add to the DNS Resolver configuration here, separated by a newline"); ?><br />
376
									</div>
377
								</td>
378
							</tr>
379
							<tr>
380
								<td colspan="2">
381
									<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
382
								</td>
383
							</tr>
384
						</tbody>
385
					</table>
386
				</div>
387
			</td>
388
		</tr>
389
	</tbody>
390
</table>
391

    
392

    
393
<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br />
394
</strong></span><?php printf(gettext("If the DNS Resolver is enabled, the DHCP".
395
" service (if enabled) will automatically serve the LAN IP".
396
" address as a DNS server to DHCP clients so they will use".
397
" the DNS Resolver. If Forwarding, is enabled, the DNS Resolver will use the DNS servers".
398
" entered in %sSystem: General setup%s".
399
" or those obtained via DHCP or PPP on WAN if the &quot;Allow".
400
" DNS server list to be overridden by DHCP/PPP on WAN&quot;".
401
" is checked."),'<a href="system.php">','</a>');?><br />
402
</span></p>
403

    
404
&nbsp;<br />
405
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="host overrides">
406
<tr>
407
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Host Overrides");?></td>
408
</tr>
409
<tr>
410
	<td><br />
411
	<?=gettext("Entries in this section override individual results from the forwarders.");?>
412
	<?=gettext("Use these for changing DNS results or for adding custom DNS records.");?>
413
	</td>
414
</tr>
415
</table>
416
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
417
	<thead>
418
	<tr>
419
		<td width="20%" class="listhdrr"><?=gettext("Host");?></td>
420
		<td width="25%" class="listhdrr"><?=gettext("Domain");?></td>
421
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
422
		<td width="30%" class="listhdr"><?=gettext("Description");?></td>
423
		<td width="5%" class="list">
424
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
425
				<tr>
426
					<td width="17"></td>
427
					<td valign="middle"><a href="services_unbound_host_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
428
				</tr>
429
			</table>
430
		</td>
431
	</tr>
432
	</thead>
433
	<tfoot>
434
	<tr>
435
		<td class="list" colspan="4"></td>
436
		<td class="list">
437
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
438
				<tr>
439
					<td width="17"></td>
440
					<td valign="middle"><a href="services_unbound_host_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
441
				</tr>
442
			</table>
443
		</td>
444
	</tr>
445
	</tfoot>
446
	<tbody>
447
	<?php $i = 0; foreach ($a_hosts as $hostent): ?>
448
	<tr>
449
		<td class="listlr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
450
			<?=strtolower($hostent['host']);?>&nbsp;
451
		</td>
452
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
453
			<?=strtolower($hostent['domain']);?>&nbsp;
454
		</td>
455
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
456
			<?=$hostent['ip'];?>&nbsp;
457
		</td>
458
		<td class="listbg" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
459
			<?=htmlspecialchars($hostent['descr']);?>&nbsp;
460
		</td>
461
		<td valign="middle" class="list nowrap">
462
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
463
				<tr>
464
					<td valign="middle"><a href="services_unbound_host_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td>
465
					<td><a href="services_unbound.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>
466
				</tr>
467
			</table>
468
	</tr>
469
	<?php if ($hostent['aliases']['item'] && is_array($hostent['aliases']['item'])): ?>
470
	<?php foreach ($hostent['aliases']['item'] as $alias): ?>
471
	<tr>
472
		<td class="listlr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
473
			<?=strtolower($alias['host']);?>&nbsp;
474
		</td>
475
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
476
			<?=strtolower($alias['domain']);?>&nbsp;
477
		</td>
478
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
479
			Alias for <?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain'];?>&nbsp;
480
		</td>
481
		<td class="listbg" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
482
			<?=htmlspecialchars($alias['description']);?>&nbsp;
483
		</td>
484
		<td valign="middle" class="list nowrap">
485
			<a href="services_unbound_host_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a>
486
		</td>
487
	</tr>
488
	<?php endforeach; ?>
489
	<?php endif; ?>
490
	<?php $i++; endforeach; ?>
491
	<tr style="display:none"><td></td></tr>
492
	</tbody>
493
</table>
494
<br />
495
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="domain overrides">
496
<tr>
497
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Domain Overrides");?></td>
498
</tr>
499
<tr>
500
	<td><p><?=gettext("Entries in this area override an entire domain by specifying an".
501
	" authoritative DNS server to be queried for that domain.");?>
502
	<?=gettext("If there are multiple authoritative DNS servers available for a domain then make a separate entry for each, using the same domain name.");?></p></td>
503
</tr>
504
</table>
505
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
506
	<thead>
507
	<tr>
508
		<td width="35%" class="listhdrr"><?=gettext("Domain");?></td>
509
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
510
		<td width="40%" class="listhdr"><?=gettext("Description");?></td>
511
		<td width="5%" class="list">
512
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
513
				<tr>
514
					<td width="17" height="17"></td>
515
					<td><a href="services_unbound_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
516
				</tr>
517
			</table>
518
		</td>
519
	</tr>
520
	</thead>
521
	<tfoot>
522
	<tr>
523
		<td class="list" colspan="3"></td>
524
		<td class="list">
525
		<table border="0" cellspacing="0" cellpadding="1" summary="add">
526
			<tr>
527
				<td width="17" height="17"></td>
528
				<td><a href="services_unbound_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
529
			</tr>
530
		</table>
531
		</td>
532
	</tr>
533
	</tfoot>
534
	<tbody>
535
	<?php $i = 0; foreach ($a_domainOverrides as $doment): ?>
536
	<tr>
537
		<td class="listlr">
538
			<?=strtolower($doment['domain']);?>&nbsp;
539
		</td>
540
		<td class="listr">
541
			<?=$doment['ip'];?>&nbsp;
542
		</td>
543
		<td class="listbg">
544
			<?=htmlspecialchars($doment['descr']);?>&nbsp;
545
		</td>
546
		<td valign="middle" class="list nowrap">
547
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
548
				<tr>
549
					<td valign="middle"><a href="services_unbound_domainoverride_edit.php?id=<?=$i;?>">
550
						<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" />
551
					</a></td>
552
					<td valign="middle"><a href="services_unbound.php?act=del&amp;type=doverride&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this domain override?");?>')">
553
						<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" />
554
					</a></td>
555
				</tr>
556
			</table>
557
		</td>
558
	</tr>
559
	<?php $i++; endforeach; ?>
560
	<tr style="display:none"><td></td></tr>
561
	</tbody>
562
</table>
563
</form>
564
<script type="text/javascript">
565
//<![CDATA[
566
enable_change(false);
567
//]]>
568
</script>
569
<?php include("fend.inc"); ?>
570
</body>
571
</html>
(170-170/256)