Project

General

Profile

« Previous | Next » 

Revision 69508c47

Added by Warren Baker almost 14 years ago

Handle domain overrides and adjust config order

View differences:

etc/inc/unbound.inc
35 35
*/
36 36

  
37 37

  
38
/* Handle Domain overrides and DNS Rebinding domains */
38 39
function unbound_add_domain_overrides($pvt=false) {
39 40
	global $config;
40 41

  
41
	$domains = $config['unbound']['domainoverrides'];
42

  
42
	$domains = $config['dns']['domainoverrides'];
43 43

  
44 44
	$sorted_domains = msort($domains, "domain");
45 45
	$result = array();		
......
66 66
			$domain_entries .= "\tstub-prime: no\n";
67 67
		}
68 68
	}
69
	return $domain_entries;
69
	if($pvt == true)
70
		return $domain_entries;
71
	else
72
		file_put_contents("{$g['unbound_chroot_path']}/etc/domainoverrides.conf", $domain_entries);
70 73
}
71 74

  
72 75

  
......
256 259
chroot: {$g['unbound_chroot_path']}
257 260
username: "unbound"
258 261
directory: "{$g['unbound_chroot_path']}/etc"
259
pidfile: "/var/run/unbound.pid"
260 262
root-hints: "root.hints"
261
harden-referral-path: no
262
prefetch: no
263
prefetch-key: no
263
pidfile: "/var/run/unbound.pid"
264 264
use-syslog: yes
265 265
port: 53
266
verbosity: 1
266
verbosity: {$config['loglevel']}
267
harden-referral-path: no
267 268
do-ip4: yes
268 269
do-ip6: yes
269 270
do-udp: yes
......
279 280
outgoing-num-tcp: 10
280 281
incoming-num-tcp: 10
281 282
edns-buffer-size: 4096
282
statistics-interval: 7200
283
extended-statistics: yes
284
statistics-cumulative: yes
285
cache-max-ttl: 86400
286
cache-min-ttl: 0
283
cache-max-ttl: {$config['cache_max_ttl']}
284
cache-min-ttl: {$config['cache_min_ttl']}
287 285
harden-dnssec-stripped: yes
288 286
{$optimization['number_threads']}
289 287
{$optimization['msg_cache_slabs']}
......
295 293
{$optimization['outgoing_range']}
296 294
{$optimization['so_rcvbuf']}
297 295
{$anchor_file}
298
prefetch: {$prefetch}
299
prefetch-key: {$prefetch_key}
296
prefetch: {$config['prefetch']}
297
prefetch-key: {$config['prefetch_key']}
300 298
# Statistics
301 299
{$statistics}
302
# Interfaces
300
# Interface IP(s) to bind to
303 301
interface: 0.0.0.0
304 302
interface: ::0
305 303

  
......
310 308
# Static host entries
311 309
include: {$g['unbound_chroot_path']}/etc/host_entries.conf
312 310

  
311
# Domain overrides
312
include: {$g['unbound_chroot_path']}/etc/domainoverrides.conf
313

  
313 314
###
314 315
# Remote Control Config
315 316
###

Also available in: Unified diff