Projet

Général

Profil

Télécharger (18,9 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / services_unbound_advanced.php @ 0fab7eb1

1
<?php
2
/* $Id$ */
3
/*
4
	services_unbound_advanced.php
5
	part of the pfSense project (https://www.pfsense.org)
6
	Copyright (C) 2011	Warren Baker (warren@pfsense.org)
7
	All rights reserved.
8

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

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

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

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

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

    
41
require_once("guiconfig.inc");
42
require_once("unbound.inc");
43

    
44
if(!is_array($config['unbound']))
45
	$config['unbound'] = array();
46
$a_unboundcfg =& $config['unbound'];
47

    
48
$pconfig['enable'] = isset($config['unbound']['enable']);
49
$pconfig['active_interface'] = $config['unbound']['active_interface'];
50
$pconfig['outgoing_interface'] = $config['unbound']['outgoing_interface'];
51
$pconfig['dnssec'] = isset($config['unbound']['dnssec']);
52
$pconfig['forwarding'] = isset($config['unbound']['forwarding']);
53
$pconfig['regdhcp'] = isset($config['unbound']['regdhcp']);
54
$pconfig['regdhcpstatic'] = isset($config['unbound']['regdhcpstatic']);
55
$pconfig['dhcpfirst'] = isset($config['unbound']['dhcpfirst']);
56
$pconfig['hideidentity'] = isset($config['unbound']['hideidentity']);
57
$pconfig['hideversion'] = isset($config['unbound']['hideversion']);
58
$pconfig['prefetch'] = isset($config['unbound']['prefetch']);
59
$pconfig['prefetchkey'] = isset($config['unbound']['prefetchkey']);
60
$pconfig['hardenglue'] = isset($config['unbound']['hardenglue']);
61
$pconfig['dnssecstripped'] = isset($config['unbound']['dnssecstripped']);
62
$pconfig['msgcachesize'] = $config['unbound']['msgcachesize'];
63
$pconfig['outgoing_num_tcp'] = $config['unbound']['outgoing_num_tcp'];
64
$pconfig['incoming_num_tcp'] = $config['unbound']['incoming_num_tcp'];
65
$pconfig['edns_buffer_size'] = $config['unbound']['edns_buffer_size'];
66
$pconfig['num_queries_per_thread'] = $config['unbound']['num_queries_per_thread'];
67
$pconfig['jostle_timeout'] = $config['unbound']['jostle_timeout'];
68
$pconfig['cache_max_ttl'] = $config['unbound']['cache_max_ttl'];
69
$pconfig['cache_min_ttl'] = $config['unbound']['cache_min_ttl'];
70
$pconfig['infra_host_ttl'] = $config['unbound']['infra_host_ttl'];
71
$pconfig['infra_lame_ttl'] = $config['unbound']['infra_lame_ttl'];
72
$pconfig['infra_cache_numhosts'] = $config['unbound']['infra_cache_numhosts'];
73
$pconfig['unwanted_reply_threshold'] = $config['unbound']['unwanted_reply_threshold'];
74
$pconfig['log_verbosity'] = isset($config['unbound']['log_verbosity']) ? $config['unbound']['log_verbosity'] : "1";
75

    
76
if ($_POST) {
77

    
78
	unset($input_errors);
79

    
80
	if (!$input_errors) {
81
		$a_unboundcfg['hideidentity'] = ($_POST['hideidentity']) ? true : false;
82
		$a_unboundcfg['hideversion'] = ($_POST['hideversion']) ? true : false;
83
		$a_unboundcfg['prefetch'] = ($_POST['prefetch']) ? true : false;
84
		$a_unboundcfg['prefetchkey'] = ($_POST['prefetchkey']) ? true : false;
85
		$a_unboundcfg['hardenglue'] = ($_POST['hardenglue']) ? true : false;
86
		$a_unboundcfg['dnssecstripped'] = ($_POST['dnssecstripped']) ? true : false;
87
		$a_unboundcfg['custom_options'] =  str_replace("\r\n", "\n", $_POST['custom_options']);
88
		write_config("DNS Resolver configured.");
89

    
90
		$retval = 0;
91
		$retval = services_unbound_configure();
92
		$savemsg = get_std_save_message($retval);
93
		if ($retval == 0)
94
			clear_subsystem_dirty('unbound');
95
	}
96
}
97

    
98
$closehead = false;
99
$pgtitle = array(gettext("Services"),gettext("DNS Resolver"),gettext("Advanced"));
100
include_once("head.inc");
101

    
102
?>
103

    
104
<script type="text/javascript">
105
//<![CDATA[
106
function enable_change(enable_over) {
107
	var endis;
108
	endis = !(jQuery('#enable').is(":checked") || enable_over);
109
	jQuery("#active_interface,#outgoing_interface,#dnssec,#forwarding,#regdhcp,#regdhcpstatic,#dhcpfirst,#port").prop('disabled', endis);
110
}
111
//]]>
112
</script>
113
</head>
114
	
115
<body>
116
<?php include("fbegin.inc"); ?>
117
<form action="services_unbound_advanced.php" method="post" name="iform" id="iform">
118
<?php if ($input_errors) print_input_errors($input_errors); ?>
119
<?php if ($savemsg) print_info_box($savemsg); ?>
120
<?php if (is_subsystem_dirty('unbound')): ?><br/>
121
<?php print_info_box_np(gettext("The configuration of the DNS Resolver, has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));?><br />
122
<?php endif; ?>
123
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="services unbound advanced">
124
	<tbody>
125
 		<tr>
126
			<td class="tabnavtbl">
127
				<?php
128
					$tab_array = array();
129
					$tab_array[] = array(gettext("General settings"), false, "services_unbound.php");
130
					$tab_array[] = array(gettext("Advanced settings"), true, "services_unbound_advanced.php");
131
					$tab_array[] = array(gettext("Access Lists"), false, "/services_unbound_acls.php");
132
					display_top_tabs($tab_array, true);
133
				?>
134
			</td>
135
		</tr>
136
		<tr>
137
			<td id="mainarea">
138
				<div class="tabcont">
139
					<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
140
						<tbody>
141
							<tr>
142
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Advanced Resolver Options");?></td>
143
							</tr>
144
							<tr>
145
								<td width="22%" valign="top" class="vncell"><?=gettext("Hide Identity");?></td>
146
								<td width="78%" class="vtable">
147
									<p><input name="hideidentity" type="checkbox" id="hideidentity" value="yes" <?php if ($pconfig['hideidentity'] === true) echo "checked=\"checked\"";?> onclick="enable_change(false)" /><br />
148
									<?=gettext("If enabled, id.server and hostname.bind queries are refused.");?></p>
149
								</td>
150
							</tr>
151
							<tr>
152
								<td width="22%" valign="top" class="vncell"><?=gettext("Hide Version");?></td>
153
								<td width="78%" class="vtable">
154
									<p><input name="enable" type="checkbox" id="hideversion" value="yes" <?php if ($pconfig['hideversion'] == "yes") echo "checked=\"checked\"";?> onclick="enable_change(false)" /><br />
155
									<?=gettext("If enabled, version.server and version.bind queries are refused.");?></p>
156
								</td>
157
							</tr>
158
							<tr>
159
								<td width="22%" valign="top" class="vncell"><?=gettext("Prefetch Support");?></td>
160
								<td width="78%" class="vtable">
161
									<p><input name="enable" type="checkbox" id="prefetch" value="yes" <?php if ($pconfig['prefetch'] == "yes") echo "checked=\"checked\"";?> onclick="enable_change(false)" /><br />
162
									<?=gettext("Message cache elements are prefetched before they expire to help keep the cache up to date. When enabled, this option can cause an increase of around 10% more DNS traffic and load on the server, but frequently requested items will not expire from the cache.");?></p>
163
								</td>
164
							</tr>
165
							<tr>
166
								<td width="22%" valign="top" class="vncell"><?=gettext("Prefetch DNS Key Support");?></td>
167
								<td width="78%" class="vtable">
168
									<p><input name="enable" type="checkbox" id="prefetchkey" value="yes" <?php if ($pconfig['prefetchkey'] == "yes") echo "checked=\"checked\"";?> onclick="enable_change(false)" /><br />
169
									<?=sprintf(gettext("DNSKEY's are fetched earlier in the validation process when a %sDelegation signer%s is encountered. This helps lower the latency of requests but does utilize a little more CPU."), "<a href='http://en.wikipedia.org/wiki/List_of_DNS_record_types'>", "</a>");?></p>
170
								</td>
171
							</tr>
172
							<tr>
173
								<td width="22%" valign="top" class="vncell"><?=gettext("Harden Glue");?></td>
174
								<td width="78%" class="vtable">
175
									<p><input name="enable" type="checkbox" id="hardenglue" value="yes" <?php if ($pconfig['hardenglue'] == "yes") echo "checked=\"checked\"";?> onclick="enable_change(false)" /><br />
176
									<?=gettext("Only trust glue if it is within the servers authority.");?></p>
177
								</td>
178
							</tr>
179
							<tr>
180
								<td width="22%" valign="top" class="vncell"><?=gettext("Harden DNSSEC data");?></td>
181
								<td width="78%" class="vtable">
182
									<p><input name="enable" type="checkbox" id="dnssecstripped" value="yes" <?php if ($pconfig['dnssecstripped'] == "yes") echo "checked=\"checked\"";?> onclick="enable_change(false)" /><br />
183
									<?=gettext("DNSSEC data is required for trust-anchored zones. If such data is absent, the zone becomes bogus. If this is disabled and no DNSSEC data is received, then the zone is made insecure.");?></p>
184
								</td>
185
							</tr>
186
							<tr>
187
								<td width="22%" valign="top" class="vncell"><?=gettext("Message Cache Size");?></td>
188
								<td width="78%" class="vtable">
189
									<p>
190
										<select id="msgcachesize" name="msgcachesize">
191
											<option value="4">4MB</option>
192
											<option value="10">10MB</option>
193
											<option value="20">20MB</option>
194
											<option value="50">50MB</option>
195
											<option value="100">100MB</option>
196
											<option value="250">250MB</option>
197
											<option value="512">512MB</option>
198
										</select><br />
199
										<?=gettext("Size of the message cache. The message cache stores DNS rcodes and validation statuses. The RRSet cache will automatically be set to twice this amount. The RRSet cache contains the actual RR data. The default is 4 megabytes.");?>
200
									</p>
201
								</td>
202
							</tr>
203
							<tr>
204
								<td width="22%" valign="top" class="vncell"><?=gettext("Outgoing TCP Buffers");?></td>
205
								<td width="78%" class="vtable">
206
									<p>
207
										<select id="outgoing_num_tcp" name="outgoing_num_tcp">
208
											<option value="0">0</option>
209
											<option value="10">10</option>
210
											<option value="20">20</option>
211
											<option value="30">30</option>
212
											<option value="40">40</option>
213
											<option value="50">50</option>
214
										</select><br />
215
										<?=gettext("The number of outgoing TCP buffers to allocate per thread. The default value is 10. If 0 is selected then no TCP queries, to authoritative servers, are done.");?>
216
									</p>
217
								</td>
218
							</tr>
219
							<tr>
220
								<td width="22%" valign="top" class="vncell"><?=gettext("Incoming TCP Buffers");?></td>
221
								<td width="78%" class="vtable">
222
									<p>
223
										<select id="incoming_num_tcp" name="incoming_num_tcp">
224
											<option value="0">0</option>
225
											<option value="10">10</option>
226
											<option value="20">20</option>
227
											<option value="30">30</option>
228
											<option value="40">40</option>
229
											<option value="50">50</option>
230
										</select><br />
231
										<?=gettext("The number of incoming TCP buffers to allocate per thread. The default value is 10. If 0 is selected then no TCP queries, from clients, are accepted.");?>
232
									</p>
233
								</td>
234
							</tr>
235
							<tr>
236
								<td width="22%" valign="top" class="vncell"><?=gettext("EDNS Buffer Size");?></td>
237
								<td width="78%" class="vtable">
238
									<p>
239
										<select id="edns_buffer_size" name="edns_buffer_size">
240
											<option value="512">512</option>
241
											<option value="1480">1480</option>
242
											<option value="4096">4096</option>
243
										</select><br />
244
										<?=gettext("Number of bytes size to advertise as the EDNS reassembly buffer size. This is the value that is used in UDP datagrams sent to peers. RFC recommendation is 4096 (which is the default). If you have fragmentation reassemble problems, usually seen as timeouts, then a value of 1480 should help. The 512 value bypasses most MTU path problems, but it can generate an excessive amount of TCP fallback.");?>
245
									</p>
246
								</td>
247
							</tr>
248
							<tr>
249
								<td width="22%" valign="top" class="vncell"><?=gettext("Number of queries per thread");?></td>
250
								<td width="78%" class="vtable">
251
									<p>
252
										<select id="num_queries_per_thread" name="num_queries_per_thread">
253
											<option value="512">512</option>
254
											<option value="1024">1024</option>
255
											<option value="2048">2048</option>
256
										</select><br />
257
										<?=gettext("The number of queries that every thread will service simultaneously. If more queries arrive that need to be serviced, and no queries can be jostled, then these queries are dropped.");?>
258
									</p>
259
								</td>
260
							</tr>
261
							<tr>
262
								<td width="22%" valign="top" class="vncell"><?=gettext("Jostle Timeout");?></td>
263
								<td width="78%" class="vtable">
264
									<p>
265
										<select id="jostle_timeout" name="jostle_timeout">
266
											<option value="100">100</option>
267
											<option value="200">200</option>
268
											<option value="500">500</option>
269
											<option value="1000">1000</option>
270
										</select><br />
271
										<?=gettext("This timeout is used for when the server is very busy. This protects against denial of service by slow queries or high query rates. The default value is 200 milliseconds.");?>
272
									</p>
273
								</td>
274
							</tr>
275
							<tr>
276
								<td width="22%" valign="top" class="vncell"><?=gettext("Maximum TTL for RRsets and messages");?></td>
277
								<td width="78%" class="vtable">
278
									<p>
279
										<input type="text" id="cache_max_ttl" name="cache_max_ttl" size="5" /><br />
280
										<?=gettext("Configure a maximum Time to live for RRsets and messages in the cache. The default is 86400 seconds (1 day). When the internal TTL expires the cache item is expired. This can be configured to force the resolver to query for data more often and not trust (very large) TTL values.");?>
281
									</p>
282
								</td>
283
							</tr>
284
							<tr>
285
								<td width="22%" valign="top" class="vncell"><?=gettext("Minimum TTL for RRsets and messages");?></td>
286
								<td width="78%" class="vtable">
287
									<p>
288
										<input type="text" id="cache_min_ttl" name="cache_min_ttl" size="5" /><br />
289
										<?=gettext("Configure a minimum Time to live for RRsets and messages in the cache. The default is 0 seconds. If the minimum value kicks in, the data is cached for longer than the domain owner intended, and thus less queries are made to look up the data. The 0 value ensures the data in the cache is as the domain owner intended. High values can lead to trouble as the data in the cache might not match up with the actual data anymore.");?>
290
									</p>
291
								</td>
292
							</tr>
293
							<tr>
294
								<td width="22%" valign="top" class="vncell"><?=gettext("TTL for Host cache entries");?></td>
295
								<td width="78%" class="vtable">
296
									<p>
297
										<select id="infra_host_ttl" name="infra_host_ttl">
298
											<option value="60">1 minute</option>
299
											<option value="120">2 minutes</option>
300
											<option value="300">5 minutes</option>
301
											<option value="600">10 minutes</option>
302
											<option value="900">15 minutes</option>
303
										</select><br />
304
										<?=gettext("Time to live for entries in the host cache. The host cache contains roundtrip timing and EDNS support information. The default is 15 minutes.");?>
305
									</p>
306
								</td>
307
							</tr>
308
							<tr>
309
								<td width="22%" valign="top" class="vncell"><?=gettext("TTL for lame delegation");?></td>
310
								<td width="78%" class="vtable">
311
									<p>
312
										<select id="infra_lame_ttl" name="infra_lame_ttl">
313
											<option value="60">1 minute</option>
314
											<option value="120">2 minutes</option>
315
											<option value="300">5 minutes</option>
316
											<option value="600">10 minutes</option>
317
											<option value="900">15 minutes</option>
318
										</select><br />
319
										<?=gettext("Time to live for when a delegation is considered to be lame. The default is 15 minutes.");?>
320
									</p>
321
								</td>
322
							</tr>
323
							<tr>
324
								<td width="22%" valign="top" class="vncell"><?=gettext("Number of Hosts to cache");?></td>
325
								<td width="78%" class="vtable">
326
									<p>
327
										<select id="infra_cache_numhosts" name="infra_cache_numhosts">
328
											<option value="1000">1000</option>
329
											<option value="5000">5000</option>
330
											<option value="10000">10 000</option>
331
											<option value="20000">20 000</option>
332
											<option value="50000">50 000</option>
333
										</select><br />
334
										<?=gettext("Number of hosts for which information is cached. The default is 10,000.");?>
335
									</p>
336
								</td>
337
							</tr>
338
							<tr>
339
								<td width="22%" valign="top" class="vncell"><?=gettext("Unwanted Reply Threshold");?></td>
340
								<td width="78%" class="vtable">
341
									<p>
342
										<select id="unwanted_reply_threshold" name="unwanted_reply_threshold">
343
											<option value="disabled">disabled</option>
344
											<option value="5000000">5 million</option>
345
											<option value="10000000">10 million</option>
346
											<option value="20000000">20 million</option>
347
											<option value="40000000">40 million</option>
348
											<option value="50000000">50 million</option>
349
										</select><br />
350
										<?=gettext("If enabled, a total number of unwanted replies is kept track of in every thread. When it reaches the threshold, a defensive action is taken and a warning is printed to the log file. This defensive action is to clear the RRSet and message caches, hopefully flushing away any poison. The default is disabled, but if enabled a value of 10 million is suggested.");?>
351
									</p>
352
								</td>
353
							</tr>
354
							<tr>
355
								<td width="22%" valign="top" class="vncell"><?=gettext("Log level verbosity");?></td>
356
								<td width="78%" class="vtable">
357
									<p>
358
										<select id="log_verbosity" name="log_verbosity">
359
											<option value="0">Level 0</option>
360
											<option value="1">Level 1</option>
361
											<option value="2">Level 2</option>
362
											<option value="3">Level 3</option>
363
											<option value="4">Level 4</option>
364
											<option value="5">Level 5</option>
365
										</select><br />
366
										<?=gettext("Select the log verbosity.");?>
367
									</p>
368
								</td>
369
							</tr>
370
							<tr>
371
								<td colspan="2">&nbsp;</td>
372
							</tr>
373
							<tr>
374
								<td width="22%"></td>
375
								<td width="78%">
376
									<input type="submit" name="Save" class="formbtn" id="save" value="Save" />
377
								</td>
378
							</tr>
379
						</tbody>
380
					</table>
381
				</div>
382
			</td>
383
		</tr>
384
	</tbody>
385
</table>
386
</form>
387
<?php include("fend.inc"); ?>
388
</body>
389
</html>
(170-170/254)