summaryrefslogtreecommitdiff
path: root/data/templates/dns-forwarding/recursor.conf.tmpl
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-04-05 18:49:47 +0200
committerChristian Poessinger <christian@poessinger.com>2020-04-05 18:49:47 +0200
commit1f0f41db4495bf5a1cf999bff108f8d3b67e45b5 (patch)
tree8e8f9cb59d40737b7422e16cde62197781e94b17 /data/templates/dns-forwarding/recursor.conf.tmpl
parent220f375b111bfb4cccb02f7a4f893046f1aa5d36 (diff)
downloadvyos-1x-1f0f41db4495bf5a1cf999bff108f8d3b67e45b5.tar.gz
vyos-1x-1f0f41db4495bf5a1cf999bff108f8d3b67e45b5.zip
dns-forwarding: T2230: move inlined templates to dedicated files
Diffstat (limited to 'data/templates/dns-forwarding/recursor.conf.tmpl')
-rw-r--r--data/templates/dns-forwarding/recursor.conf.tmpl44
1 files changed, 44 insertions, 0 deletions
diff --git a/data/templates/dns-forwarding/recursor.conf.tmpl b/data/templates/dns-forwarding/recursor.conf.tmpl
new file mode 100644
index 000000000..9d1e019fa
--- /dev/null
+++ b/data/templates/dns-forwarding/recursor.conf.tmpl
@@ -0,0 +1,44 @@
+### Autogenerated by dns_forwarding.py ###
+
+# XXX: pdns recursor doesn't like whitespace near entry separators,
+# especially in the semicolon-separated lists of name servers.
+# Please be careful if you edit the template.
+
+# Non-configurable defaults
+daemon=yes
+threads=1
+allow-from={{ allow_from | join(',') }}
+log-common-errors=yes
+non-local-bind=yes
+query-local-address=0.0.0.0
+query-local-address6=::
+
+# cache-size
+max-cache-entries={{ cache_size }}
+
+# negative TTL for NXDOMAIN
+max-negative-ttl={{ negative_ttl }}
+
+# ignore-hosts-file
+export-etc-hosts={{ export_hosts_file }}
+
+# listen-on
+local-address={{ listen_on | join(',') }}
+
+# dnssec
+dnssec={{ dnssec }}
+
+# forward-zones / recursion
+#
+# statement is only inserted if either one forwarding domain or nameserver is configured
+# if nothing is given at all, powerdns will act as a real recursor and resolve all requests by its own
+#
+{% if name_servers or domains %}forward-zones-recurse=
+{%- for d in domains %}
+{{ d.name }}={{ d.servers | join(";") }}
+{{- ", " if not loop.last -}}
+{%- endfor -%}
+{%- if name_servers -%}
+{%- if domains -%}, {% endif -%}.={{ name_servers | join(';') }}
+{% endif %}
+{% endif %}