kresd.j2 2.81 KB
Newer Older
1
net = { '{{SELF_ADDR}}' }
2
modules = {'stats', 'policy', 'hints'}
3 4
-- test. domain is used by some tests, allow it
policy.add(policy.suffix(policy.PASS, {todname('test.')}))
5 6
-- extra verbose logging for answers received from network
policy.add(policy.all(policy.QTRACE))
7
cache.size = 2*MB
Marek Vavruša's avatar
Marek Vavruša committed
8
hints.root({['k.root-servers.net'] = '{{ROOT_ADDR}}'})
9 10 11 12 13
{% if QMIN == "false" %}
option('NO_MINIMIZE', true)
{% else %}
option('NO_MINIMIZE', false)
{% endif %}
14 15 16 17 18
{% if DO_NOT_QUERY_LOCALHOST == "false" %}
option('ALLOW_LOCAL', true)
{% else %}
option('ALLOW_LOCAL', false)
{% endif %}
19 20 21 22 23 24

{% if HARDEN_GLUE == "true" %}
mode('normal')
{% else %}
mode('permissive')
{% endif %}
25 26
-- Always retry failing resolver
option('NO_THROTTLE', true)
27

28 29
-- make sure that value specified at compile-type does not break tests
trust_anchors.keyfile_default = nil
30 31
{% for TAF in TRUST_ANCHOR_FILES %}
trust_anchors.add_file('{{TAF}}')
32
{% endfor %}
33 34 35 36 37 38
trust_anchors.set_insecure({
{% for DI in NEGATIVE_TRUST_ANCHORS %}
"{{DI}}",
{% endfor %}
})

39

40 41 42 43 44 45 46 47
{% 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 %}

48
{% if FEATURES.dns64_prefix is defined %}
49
modules.load( 'dns64')
50 51
dns64.config('{{FEATURES.dns64_prefix}}')
{% endif %}
52 53 54 55 56 57 58

{% 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 %}

59 60 61 62 63 64 65
{% 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 %}

66 67 68 69
{% for policy in FEATURES.policy %}
{{policy}}
{% endfor %}

70 71 72 73 74 75 76
{% if FEATURES.view is defined %}
modules.load( 'view')
{% for view in FEATURES.view %}
{{view}}
{% endfor %}
{% endif %}

77 78 79 80
{% if FEATURES.workarounds is defined %}
modules = { 'workarounds < iterate' }
{% endif %}

81 82 83 84 85
-- Disable RFC8145 signaling, scenario doesn't provide expected ansers
if ta_signal_query then
	modules.unload('ta_signal_query')
end

Vitezslav Kriz's avatar
Vitezslav Kriz committed
86 87 88 89 90
-- Disable RFC8109 priming, scenario doesn't provide expected ansers
if priming then
	modules.unload('priming')
end

91 92 93 94 95
-- Disable this module because it make one priming query.
if detect_time_skew then
	modules.unload('detect_time_skew')
end

Marek Vavruša's avatar
Marek Vavruša committed
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
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)