1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
net = { '{{SELF_ADDR}}' }
modules = {'stats', 'policy', 'hints'}
-- test. domain is used by some tests, allow it
policy.add(policy.suffix(policy.PASS, {todname('test.')}))
-- extra verbose logging for answers received from network
policy.add(policy.all(policy.QTRACE))
cache.size = 2*MB
hints.root({['k.root-servers.net'] = '{{ROOT_ADDR}}'})
{% if QMIN == "false" %}
option('NO_MINIMIZE', true)
{% else %}
option('NO_MINIMIZE', false)
{% endif %}
{% if DO_NOT_QUERY_LOCALHOST == "false" %}
option('ALLOW_LOCAL', true)
{% else %}
option('ALLOW_LOCAL', false)
{% endif %}
{% if HARDEN_GLUE == "true" %}
mode('normal')
{% else %}
mode('permissive')
{% endif %}
-- Always retry failing resolver
option('NO_THROTTLE', true)
{% for TAF in TRUST_ANCHOR_FILES %}
trust_anchors.add_file('{{TAF}}')
{% endfor %}
trust_anchors.set_insecure({
{% for DI in NEGATIVE_TRUST_ANCHORS %}
"{{DI}}",
{% endfor %}
})
{% if FEATURES.min_ttl is defined %}
cache.min_ttl({{FEATURES.min_ttl}})
{% endif %}
{% if FEATURES.max_ttl is defined %}
cache.max_ttl({{FEATURES.max_ttl}})
{% endif %}
{% if FEATURES.dns64_prefix is defined %}
modules.load( 'dns64')
dns64.config('{{FEATURES.dns64_prefix}}')
{% endif %}
{% if FEATURES.static_hint_name is defined %}
{% if FEATURES.static_hint_addr is defined %}
hints['{{FEATURES.static_hint_name}}'] = '{{FEATURES.static_hint_addr}}'
{% endif %}
{% endif %}
{% if FEATURES.renumber_src is defined %}
{% if FEATURES.renumber_dst is defined %}
modules.load( 'renumber')
renumber.config({{ '{{' }}'{{FEATURES.renumber_src}}','{{FEATURES.renumber_dst}}' {{ '}}' }})
{% endif %}
{% endif %}
{% for policy in FEATURES.policy %}
{{policy}}
{% endfor %}
{% if FEATURES.view is defined %}
modules.load( 'view')
{% for view in FEATURES.view %}
{{view}}
{% endfor %}
{% endif %}
{% if FEATURES.workarounds is defined %}
modules = { 'workarounds < iterate' }
{% endif %}
-- Disable RFC8145 signaling, scenario doesn't provide expected ansers
if ta_signal_query then
modules.unload('ta_signal_query')
end
-- Disable RFC8109 priming, scenario doesn't provide expected ansers
if priming then
modules.unload('priming')
end
-- Disable this module because it make one priming query.
if detect_time_skew then
modules.unload('detect_time_skew')
end
verbose(true)
-- Self-checks on globals
assert(help() ~= nil)
assert(worker.id ~= nil)
-- Self-checks on facilities
assert(cache.count() == 0)
assert(cache.stats() ~= nil)
assert(cache.backends() ~= nil)
assert(worker.stats() ~= nil)
assert(net.interfaces() ~= nil)
-- Self-checks on loaded stuff
assert(net.list()['{{SELF_ADDR}}'])
assert(#modules.list() > 0)
-- Self-check timers
ev = event.recurrent(1 * sec, function (ev) return 1 end)
event.cancel(ev)
ev = event.after(0, function (ev) return 1 end)
|