diff --git a/template/kresd.j2 b/template/kresd.j2 index 9df50f860b96c70a1ad7f4df37ee9de31b3ec2d2..ba94ca602b9a447eb6267e2c68bfd96f6768c925 100644 --- a/template/kresd.j2 +++ b/template/kresd.j2 @@ -1,4 +1,10 @@ net = { '{{SELF_ADDR}}' } +{% if ':' in SELF_ADDR %} +net.outgoing_v6('{{SELF_ADDR}}') +{% else %} +net.outgoing_v4('{{SELF_ADDR}}') +{% endif %} + net.bufsize(4096) modules = {'stats', 'policy', 'hints'} diff --git a/template/pdns_recursor.j2 b/template/pdns_recursor.j2 index eee0708cc8792b00f60112131fa26990aff67072..56867750e7de3a6e2b8ff77e451ec9564a4ac718 100644 --- a/template/pdns_recursor.j2 +++ b/template/pdns_recursor.j2 @@ -214,11 +214,17 @@ max-cache-entries=1000000 ################################# # query-local-address Source IP address for sending queries # +{% if ':' in SELF_ADDR %} query-local-address=0.0.0.0 +query-local-address6={{SELF_ADDR}} +{% else %} +query-local-address={{SELF_ADDR}} +query-local-address6=:: +{% endif %} ################################# # query-local-address6 Source IPv6 address for sending queries -query-local-address6=:: +# query-local-address6=:: ################################# # quiet Suppress logging of questions and answers diff --git a/template/unbound.j2 b/template/unbound.j2 index 2f7866f098d1aace5cba8d98076ffb11daf29c1d..1ee5a9f7de7b0bfbe4a0b94b889073437db17972 100644 --- a/template/unbound.j2 +++ b/template/unbound.j2 @@ -66,7 +66,7 @@ server: # specify the interfaces to send outgoing queries to authoritative # server from by ip-address. If none, the default (all) interface # is used. Specify every interface on a 'outgoing-interface:' line. - # outgoing-interface: 192.0.2.153 + outgoing-interface: {{SELF_ADDR}} # outgoing-interface: 2001:DB8::5 # outgoing-interface: 2001:DB8::6