Project

General

Profile

Download (23 KB) Statistics
| Branch: | Tag: | Revision:
1 7ed0e844 Warren Baker
<?php
2
/* $Id$ */
3
/*
4
	services_unbound.php
5 c7281770 Chris Buechler
	part of the pfSense project (https://www.pfsense.org)
6 fff4a9d1 Warren Baker
	Copyright (C) 2014	Warren Baker (warren@pfsense.org)
7 6317d31d Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
8 7ed0e844 Warren Baker
	All rights reserved.
9
10
	Redistribution and use in source and binary forms, with or without
11 fff4a9d1 Warren Baker
	modification, are permitted provided that the following conditions are met:
12 7ed0e844 Warren Baker
13 a88ec513 Renato Botelho
	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 7ed0e844 Warren Baker
*/
31
/*
32 80948260 Warren Baker
	pfSense_MODULE:	dnsresolver
33 7ed0e844 Warren Baker
*/
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 4dbcf2fb Renato Botelho
require_once("system.inc");
45 7ed0e844 Warren Baker
46 be11b6f1 Warren Baker
if (!is_array($config['unbound'])) {
47 2783e408 Renato Botelho
	$config['unbound'] = array();
48 be11b6f1 Warren Baker
}
49
50 7ed0e844 Warren Baker
$a_unboundcfg =& $config['unbound'];
51
52 be11b6f1 Warren Baker
if (!is_array($config['unbound']['hosts'])) {
53 2783e408 Renato Botelho
	$config['unbound']['hosts'] = array();
54 be11b6f1 Warren Baker
}
55
56 7ed0e844 Warren Baker
$a_hosts =& $config['unbound']['hosts'];
57
58 be11b6f1 Warren Baker
if (!is_array($config['unbound']['domainoverrides'])) {
59 2783e408 Renato Botelho
	$config['unbound']['domainoverrides'] = array();
60 be11b6f1 Warren Baker
}
61
62 7ed0e844 Warren Baker
$a_domainOverrides = &$config['unbound']['domainoverrides'];
63
64 be11b6f1 Warren Baker
if (isset($config['unbound']['enable'])) {
65 fe9d4894 Renato Botelho
	$pconfig['enable'] = true;
66 be11b6f1 Warren Baker
}
67
if (isset($config['unbound']['dnssec'])) {
68 fe9d4894 Renato Botelho
	$pconfig['dnssec'] = true;
69 be11b6f1 Warren Baker
}
70
if (isset($config['unbound']['forwarding'])) {
71 fe9d4894 Renato Botelho
	$pconfig['forwarding'] = true;
72 be11b6f1 Warren Baker
}
73
if (isset($config['unbound']['regdhcp'])) {
74 fe9d4894 Renato Botelho
	$pconfig['regdhcp'] = true;
75 be11b6f1 Warren Baker
}
76
if (isset($config['unbound']['regdhcpstatic'])) {
77 fe9d4894 Renato Botelho
	$pconfig['regdhcpstatic'] = true;
78 be11b6f1 Warren Baker
}
79
if (isset($config['unbound']['txtsupport'])) {
80 fe9d4894 Renato Botelho
	$pconfig['txtsupport'] = true;
81 be11b6f1 Warren Baker
}
82 615ae81f Renato Botelho
83
$pconfig['port'] = $config['unbound']['port'];
84 0a23cddc Renato Botelho
$pconfig['custom_options'] = base64_decode($config['unbound']['custom_options']);
85 615ae81f Renato Botelho
86 be11b6f1 Warren Baker
if (empty($config['unbound']['active_interface'])) {
87 2783e408 Renato Botelho
	$pconfig['active_interface'] = array();
88 be11b6f1 Warren Baker
} else {
89 2783e408 Renato Botelho
	$pconfig['active_interface'] = explode(",", $config['unbound']['active_interface']);
90 be11b6f1 Warren Baker
}
91
if (empty($config['unbound']['outgoing_interface'])) {
92 2783e408 Renato Botelho
	$pconfig['outgoing_interface'] = array();
93 be11b6f1 Warren Baker
} else {
94 2783e408 Renato Botelho
	$pconfig['outgoing_interface'] = explode(",", $config['unbound']['outgoing_interface']);
95 be11b6f1 Warren Baker
}
96 615ae81f Renato Botelho
97 7ed0e844 Warren Baker
if ($_POST) {
98 2783e408 Renato Botelho
	$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 fe9d4894 Renato Botelho
		}
107 2783e408 Renato Botelho
		/* Update resolv.conf in case the interface bindings exclude localhost. */
108
		system_resolvconf_generate();
109 4dbcf2fb Renato Botelho
		/* Start or restart dhcpleases when it's necessary */
110
		system_dhcpleases_configure();
111 2783e408 Renato Botelho
	} else {
112
		if (isset($_POST['enable']) && isset($config['dnsmasq']['enable'])) {
113 0fe628a6 Chris Buechler
			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 fe9d4894 Renato Botelho
		}
116 615ae81f Renato Botelho
117 2783e408 Renato Botelho
		if (empty($_POST['active_interface'])) {
118 b026cb18 Chris Buechler
			$input_errors[] = "One or more Network Interfaces must be selected for binding.";
119 b7960673 Chris Buechler
		} 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 fe9d4894 Renato Botelho
		}
122 7ed0e844 Warren Baker
123 2783e408 Renato Botelho
		if (empty($_POST['outgoing_interface'])) {
124 b026cb18 Chris Buechler
			$input_errors[] = "One or more Outgoing Network Interfaces must be selected.";
125 fe9d4894 Renato Botelho
		}
126 7ed0e844 Warren Baker
127 2783e408 Renato Botelho
		if ($_POST['port']) {
128
			if (is_port($_POST['port'])) {
129
				$a_unboundcfg['port'] = $_POST['port'];
130 fe9d4894 Renato Botelho
			} else {
131 2783e408 Renato Botelho
				$input_errors[] = gettext("You must specify a valid port number.");
132 fe9d4894 Renato Botelho
			}
133
		} else if (isset($config['unbound']['port'])) {
134 2783e408 Renato Botelho
			unset($config['unbound']['port']);
135 fe9d4894 Renato Botelho
		}
136 fff4a9d1 Warren Baker
137 2783e408 Renato Botelho
		if (isset($_POST['enable'])) {
138
			$a_unboundcfg['enable'] = true;
139 fe9d4894 Renato Botelho
		} else {
140 2783e408 Renato Botelho
			unset($a_unboundcfg['enable']);
141 fe9d4894 Renato Botelho
		}
142 2783e408 Renato Botelho
		if (isset($_POST['dnssec'])) {
143
			$a_unboundcfg['dnssec'] = true;
144 fe9d4894 Renato Botelho
		} else {
145 2783e408 Renato Botelho
			unset($a_unboundcfg['dnssec']);
146 fe9d4894 Renato Botelho
		}
147 2783e408 Renato Botelho
		if (isset($_POST['forwarding'])) {
148
			$a_unboundcfg['forwarding'] = true;
149 fe9d4894 Renato Botelho
		} else {
150 2783e408 Renato Botelho
			unset($a_unboundcfg['forwarding']);
151 fe9d4894 Renato Botelho
		}
152
		if (isset($_POST['regdhcp'])) {
153 2783e408 Renato Botelho
			$a_unboundcfg['regdhcp'] = true;
154 fe9d4894 Renato Botelho
		} else {
155 2783e408 Renato Botelho
			unset($a_unboundcfg['regdhcp']);
156 fe9d4894 Renato Botelho
		}
157 2783e408 Renato Botelho
		if (isset($_POST['regdhcpstatic'])) {
158
			$a_unboundcfg['regdhcpstatic'] = true;
159 fe9d4894 Renato Botelho
		} else {
160 2783e408 Renato Botelho
			unset($a_unboundcfg['regdhcpstatic']);
161 fe9d4894 Renato Botelho
		}
162 2783e408 Renato Botelho
		if (isset($_POST['txtsupport'])) {
163
			$a_unboundcfg['txtsupport'] = true;
164 fe9d4894 Renato Botelho
		} else {
165 2783e408 Renato Botelho
			unset($a_unboundcfg['txtsupport']);
166 fe9d4894 Renato Botelho
		}
167 2783e408 Renato Botelho
		if (is_array($_POST['active_interface']) && !empty($_POST['active_interface'])) {
168
			$a_unboundcfg['active_interface'] = implode(",", $_POST['active_interface']);
169 fe9d4894 Renato Botelho
		}
170 7ed0e844 Warren Baker
171 2783e408 Renato Botelho
		if (is_array($_POST['outgoing_interface']) && !empty($_POST['outgoing_interface'])) {
172
			$a_unboundcfg['outgoing_interface'] = implode(",", $_POST['outgoing_interface']);
173 fe9d4894 Renato Botelho
		}
174 188609c6 Warren Baker
175 0a23cddc Renato Botelho
		$a_unboundcfg['custom_options'] = base64_encode(str_replace("\r\n", "\n", $_POST['custom_options']));
176 7ed0e844 Warren Baker
177 2783e408 Renato Botelho
		if (!$input_errors) {
178
			write_config("DNS Resolver configured.");
179
			mark_subsystem_dirty('unbound');
180
		}
181
	}
182 7ed0e844 Warren Baker
}
183
184 f2bc186f Warren Baker
if ($_GET['act'] == "del") {
185 2783e408 Renato Botelho
	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 f2bc186f Warren Baker
}
203
204 931f47ea Colin Fleming
$closehead = false;
205 7ed0e844 Warren Baker
$pgtitle = array(gettext("Services"),gettext("DNS Resolver"));
206 8f6875de Phil Davis
$shortcut_section = "resolver";
207 7ed0e844 Warren Baker
include_once("head.inc");
208
209
?>
210
211 fff4a9d1 Warren Baker
<script type="text/javascript">
212 2783e408 Renato Botelho
//<![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 7ed0e844 Warren Baker
</script>
224 931f47ea Colin Fleming
</head>
225 a88ec513 Renato Botelho
226 7ed0e844 Warren Baker
<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 931f47ea Colin Fleming
<?php if (is_subsystem_dirty('unbound')): ?><br/>
232 b026cb18 Chris Buechler
<?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 7ed0e844 Warren Baker
<?php endif; ?>
234 13ecf949 Warren Baker
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="services unbound">
235 2783e408 Renato Botelho
	<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 32a81561 Jean Cyr
										$interface_addresses = get_possible_listen_ips(false);
278 2783e408 Renato Botelho
										$size=count($interface_addresses)+1;
279
									?>
280
									<?=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.");?>
281
									<br /><br />
282 b026cb18 Chris Buechler
									<select id="active_interface" name="active_interface[]" multiple="multiple" size="<?php echo $size; ?>">
283 b7960673 Chris Buechler
										<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>
284 2783e408 Renato Botelho
										<?php
285
											foreach ($interface_addresses as $laddr):
286
												$selected = "";
287
												if (in_array($laddr['value'], $pconfig['active_interface']))
288
													$selected = 'selected="selected"';
289
										?>
290
										<option value="<?=$laddr['value'];?>" <?=$selected;?>>
291
											<?=htmlspecialchars($laddr['name']);?>
292
										</option>
293
										<?php endforeach; ?>
294
									</select>
295
									<br /><br />
296
								</td>
297
							</tr>
298
							<tr>
299
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Outgoing Network Interfaces"); ?></td>
300
								<td width="78%" class="vtable">
301
									<?php
302 32a81561 Jean Cyr
										$interface_addresses = get_possible_listen_ips(false);
303 2783e408 Renato Botelho
										$size=count($interface_addresses)+1;
304
									?>
305
									<?=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.");?>
306
									<br /><br />
307 b026cb18 Chris Buechler
									<select id="outgoing_interface" name="outgoing_interface[]" multiple="multiple" size="<?php echo $size; ?>">
308 2783e408 Renato Botelho
										<option value="" <?php if (empty($pconfig['outgoing_interface']) || empty($pconfig['outgoing_interface'][0])) echo 'selected="selected"'; ?>>All</option>
309
										<?php
310
											foreach ($interface_addresses as $laddr):
311
												$selected = "";
312
												if (in_array($laddr['value'], $pconfig['outgoing_interface']))
313
												$selected = 'selected="selected"';
314
										?>
315
										<option value="<?=$laddr['value'];?>" <?=$selected;?>>
316
											<?=htmlspecialchars($laddr['name']);?>
317
										</option>
318
										<?php endforeach; ?>
319
									</select>
320
									<br /><br />
321
								</td>
322
							</tr>
323
							<tr>
324
								<td width="22%" valign="top" class="vncellreq"><?=gettext("DNSSEC");?></td>
325
								<td width="78%" class="vtable"><p>
326
									<input name="dnssec" type="checkbox" id="dnssec" value="yes" <?php echo (isset($pconfig['dnssec']) ? "checked=\"checked\"" : "");?> />
327
									<strong><?=gettext("Enable DNSSEC Support");?><br />
328
									</strong></p>
329
								</td>
330
							</tr>
331
							<tr>
332
								<td width="22%" valign="top" class="vncellreq"><?=gettext("DNS Query Forwarding");?></td>
333
								<td width="78%" class="vtable"><p>
334
									<input name="forwarding" type="checkbox" id="forwarding" value="yes" <?php echo (isset($pconfig['forwarding']) ? "checked=\"checked\"" : "");?> />
335
									<strong><?=gettext("Enable Forwarding Mode");?></strong><br /></p>
336
								</td>
337
							</tr>
338
							<tr>
339
								<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCP Registration");?></td>
340
								<td width="78%" class="vtable"><p>
341
									<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?php if (isset($pconfig['regdhcp'])) echo "checked=\"checked\"";?> />
342
									<strong><?=gettext("Register DHCP leases in the DNS Resolver");?><br />
343
									</strong><?php printf(gettext("If this option is set, then machines that specify".
344
									" their hostname when requesting a DHCP lease will be registered".
345
									" in the DNS Resolver, so that their name can be resolved.".
346
									" You should also set the domain in %sSystem:".
347
									" General setup%s to the proper value."),'<a href="system.php">','</a>')?></p>
348
								</td>
349
							</tr>
350
							<tr>
351
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Static DHCP");?></td>
352
								<td width="78%" class="vtable"><p>
353
									<input name="regdhcpstatic" type="checkbox" id="regdhcpstatic" value="yes" <?php if (isset($pconfig['regdhcpstatic'])) echo "checked=\"checked\"";?> />
354
									<strong><?=gettext("Register DHCP static mappings in the DNS Resolver");?><br />
355
									</strong><?php printf(gettext("If this option is set, then DHCP static mappings will ".
356
											"be registered in the DNS Resolver, so that their name can be ".
357
											"resolved. You should also set the domain in %s".
358
											"System: General setup%s to the proper value."),'<a href="system.php">','</a>');?></p>
359
								</td>
360
							</tr>
361
							<tr>
362
								<td width="22%" valign="top" class="vncellreq"><?=gettext("TXT Comment Support");?></td>
363
								<td width="78%" class="vtable"><p>
364
									<input name="txtsupport" type="checkbox" id="txtsupport" value="yes" <?php echo (isset($pconfig['txtsupport']) ? "checked=\"checked\"" : "");?> />
365
									<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 />
366
									</strong></p>
367
								</td>
368
							</tr>
369
							<tr>
370
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
371
								<td width="78%" class="vtable">
372
									<div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
373
										<input type="button" onclick="show_advanced_dns()" value="<?=gettext("Advanced"); ?>" /> - <?=gettext("Show advanced option");?>
374
									</div>
375
									<div id="showadv" <?php if (empty($pconfig['custom_options'])) echo "style='display:none'"; ?>>
376
										<strong><?=gettext("Advanced");?><br /></strong>
377
										<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=htmlspecialchars($pconfig['custom_options']);?></textarea><br />
378 b5acc797 Chris Buechler
										<?=gettext("Enter any additional configuration parameters to add to the DNS Resolver configuration here, separated by a newline"); ?><br />
379 2783e408 Renato Botelho
									</div>
380
								</td>
381
							</tr>
382
							<tr>
383
								<td colspan="2">
384
									<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
385
								</td>
386
							</tr>
387
						</tbody>
388
					</table>
389
				</div>
390
			</td>
391
		</tr>
392
	</tbody>
393 7ed0e844 Warren Baker
</table>
394
395
396 8cd558b6 ayvis
<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br />
397 2783e408 Renato Botelho
</strong></span><?php printf(gettext("If the DNS Resolver is enabled, the DHCP".
398
" service (if enabled) will automatically serve the LAN IP".
399
" address as a DNS server to DHCP clients so they will use".
400
" the DNS Resolver. If Forwarding, is enabled, the DNS Resolver will use the DNS servers".
401
" entered in %sSystem: General setup%s".
402
" or those obtained via DHCP or PPP on WAN if the &quot;Allow".
403
" DNS server list to be overridden by DHCP/PPP on WAN&quot;".
404
" is checked."),'<a href="system.php">','</a>');?><br />
405 7ed0e844 Warren Baker
</span></p>
406
407 8cd558b6 ayvis
&nbsp;<br />
408 931f47ea Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="host overrides">
409 2783e408 Renato Botelho
<tr>
410
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Host Overrides");?></td>
411
</tr>
412
<tr>
413
	<td><br />
414
	<?=gettext("Entries in this section override individual results from the forwarders.");?>
415
	<?=gettext("Use these for changing DNS results or for adding custom DNS records.");?>
416
	</td>
417
</tr>
418 7ed0e844 Warren Baker
</table>
419 931f47ea Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
420 2783e408 Renato Botelho
	<thead>
421
	<tr>
422
		<td width="20%" class="listhdrr"><?=gettext("Host");?></td>
423
		<td width="25%" class="listhdrr"><?=gettext("Domain");?></td>
424
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
425
		<td width="30%" class="listhdr"><?=gettext("Description");?></td>
426
		<td width="5%" class="list">
427
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
428
				<tr>
429
					<td width="17"></td>
430
					<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>
431
				</tr>
432
			</table>
433
		</td>
434
	</tr>
435
	</thead>
436
	<tfoot>
437
	<tr>
438
		<td class="list" colspan="4"></td>
439
		<td class="list">
440
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
441
				<tr>
442
					<td width="17"></td>
443
					<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>
444
				</tr>
445
			</table>
446
		</td>
447
	</tr>
448
	</tfoot>
449
	<tbody>
450
	<?php $i = 0; foreach ($a_hosts as $hostent): ?>
451
	<tr>
452
		<td class="listlr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
453
			<?=strtolower($hostent['host']);?>&nbsp;
454
		</td>
455
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
456
			<?=strtolower($hostent['domain']);?>&nbsp;
457
		</td>
458
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
459
			<?=$hostent['ip'];?>&nbsp;
460
		</td>
461
		<td class="listbg" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
462
			<?=htmlspecialchars($hostent['descr']);?>&nbsp;
463
		</td>
464
		<td valign="middle" class="list nowrap">
465
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
466
				<tr>
467
					<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>
468
					<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>
469
				</tr>
470
			</table>
471
	</tr>
472 3fc92f97 Phil Davis
	<?php if ($hostent['aliases']['item'] && is_array($hostent['aliases']['item'])): ?>
473
	<?php foreach ($hostent['aliases']['item'] as $alias): ?>
474
	<tr>
475
		<td class="listlr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
476
			<?=strtolower($alias['host']);?>&nbsp;
477
		</td>
478
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
479
			<?=strtolower($alias['domain']);?>&nbsp;
480
		</td>
481
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
482
			Alias for <?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain'];?>&nbsp;
483
		</td>
484
		<td class="listbg" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
485
			<?=htmlspecialchars($alias['description']);?>&nbsp;
486
		</td>
487
		<td valign="middle" class="list nowrap">
488
			<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>
489
		</td>
490
	</tr>
491
	<?php endforeach; ?>
492
	<?php endif; ?>
493 2783e408 Renato Botelho
	<?php $i++; endforeach; ?>
494
	<tr style="display:none"><td></td></tr>
495
	</tbody>
496 7ed0e844 Warren Baker
</table>
497 8cd558b6 ayvis
<br />
498 931f47ea Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="domain overrides">
499 2783e408 Renato Botelho
<tr>
500
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Domain Overrides");?></td>
501
</tr>
502
<tr>
503
	<td><p><?=gettext("Entries in this area override an entire domain by specifying an".
504 222e6390 Phil Davis
	" authoritative DNS server to be queried for that domain.");?>
505
	<?=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>
506 2783e408 Renato Botelho
</tr>
507 7ed0e844 Warren Baker
</table>
508 931f47ea Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
509 2783e408 Renato Botelho
	<thead>
510
	<tr>
511
		<td width="35%" class="listhdrr"><?=gettext("Domain");?></td>
512
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
513
		<td width="40%" class="listhdr"><?=gettext("Description");?></td>
514
		<td width="5%" class="list">
515
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
516
				<tr>
517
					<td width="17" height="17"></td>
518
					<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>
519
				</tr>
520
			</table>
521
		</td>
522
	</tr>
523
	</thead>
524
	<tfoot>
525
	<tr>
526
		<td class="list" colspan="3"></td>
527
		<td class="list">
528
		<table border="0" cellspacing="0" cellpadding="1" summary="add">
529
			<tr>
530
				<td width="17" height="17"></td>
531
				<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>
532
			</tr>
533
		</table>
534
		</td>
535
	</tr>
536
	</tfoot>
537
	<tbody>
538
	<?php $i = 0; foreach ($a_domainOverrides as $doment): ?>
539
	<tr>
540
		<td class="listlr">
541
			<?=strtolower($doment['domain']);?>&nbsp;
542
		</td>
543
		<td class="listr">
544
			<?=$doment['ip'];?>&nbsp;
545
		</td>
546
		<td class="listbg">
547
			<?=htmlspecialchars($doment['descr']);?>&nbsp;
548
		</td>
549
		<td valign="middle" class="list nowrap">
550
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
551
				<tr>
552
					<td valign="middle"><a href="services_unbound_domainoverride_edit.php?id=<?=$i;?>">
553
						<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" />
554
					</a></td>
555
					<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?");?>')">
556
						<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" />
557
					</a></td>
558
				</tr>
559
			</table>
560
		</td>
561
	</tr>
562
	<?php $i++; endforeach; ?>
563
	<tr style="display:none"><td></td></tr>
564
	</tbody>
565 7ed0e844 Warren Baker
</table>
566
</form>
567 fff4a9d1 Warren Baker
<script type="text/javascript">
568 2783e408 Renato Botelho
//<![CDATA[
569
enable_change(false);
570
//]]>
571 7ed0e844 Warren Baker
</script>
572
<?php include("fend.inc"); ?>
573
</body>
574
</html>