X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Funbound%2Ftemplates%2Funbound.conf.erb;h=2caa955017f23173fe9e513bd0fba3057175710d;hb=70d1fadf0a56e62a170f44a9bfa12d30b9465b78;hp=d909f74c974b8dab45ee15d810318cb36d698b70;hpb=8bfea2ec8e5dc4875a907fe4b35616a9e63f2d8a;p=mirror%2Fdsa-puppet.git diff --git a/modules/unbound/templates/unbound.conf.erb b/modules/unbound/templates/unbound.conf.erb index d909f74c9..2caa95501 100644 --- a/modules/unbound/templates/unbound.conf.erb +++ b/modules/unbound/templates/unbound.conf.erb @@ -6,26 +6,22 @@ server: verbosity: 1 -<%= - out = [] - if scope.lookupvar('site::nodeinfo')['misc']['resolver-recursive'] and scope.lookupvar('site::nodeinfo')['hoster']['allow_dns_query'] - out << " interface: 0.0.0.0" - out << " interface: ::0" - out << "" - out << " interface-automatic: yes" +<% if (@is_recursor and (not @client_ranges.empty?)) -%> + interface: 0.0.0.0 + interface: ::0 - out << " access-control: 0.0.0.0/0 refuse" - out << " access-control: ::0/0 refuse" - out << " access-control: 127.0.0.0/8 allow" - out << " access-control: ::0/0 refuse" - out << " access-control: ::1 allow" - out << " access-control: ::ffff:127.0.0.1 allow" - scope.lookupvar('site::nodeinfo')['hoster']['allow_dns_query'].each do |net| - out << " access-control: #{net} allow" - end - end - out.join("\n") -%> + interface-automatic: yes + + access-control: 0.0.0.0/0 refuse + access-control: ::0/0 refuse + access-control: 127.0.0.0/8 allow + access-control: ::0/0 refuse + access-control: ::1 allow + access-control: ::ffff:127.0.0.1 allow +<% @client_ranges.to_a.flatten.each do |net| -%> + access-control: <%= net -%> allow +<% end -%> +<% end -%> #chroot: "" @@ -47,24 +43,26 @@ server: # auto-trust-anchor-file: "" auto-trust-anchor-file: "/var/lib/unbound/root.key" auto-trust-anchor-file: "/var/lib/unbound/debian.org.key" + auto-trust-anchor-file: "/var/lib/unbound/29.172.in-addr.arpa.key" -<%= - out = [] - if not scope.lookupvar('site::nodeinfo')['misc']['resolver-recursive'] and not scope.lookupvar('site::nodeinfo')['hoster']['nameservers_break_dnssec'] - forwarders = scope.lookupvar('site::nodeinfo')['hoster']['nameservers'] - forwarders ||= [] - - out << 'forward-zone:' - out << ' name: "."' - forwarders.each do |ns| - out << " forward-addr: #{ns}" - end - end - + prefetch: yes + prefetch-key: yes - if hostname == "zappa" - out << "edns-buffer-size: 512" - end +local-zone: "29.172.in-addr.arpa" nodefault +forward-zone: + name: "29.172.in-addr.arpa" + forward-host: geo1.debian.org + forward-host: geo2.debian.org + forward-host: geo3.debian.org - out.join("\n") -%> +# recursive: <%= @is_recursor ? "y" : "n" %> +<% if not @is_recursor -%> +forward-zone: + name: "." +<% @ns.to_a.flatten.each do |nms| -%> + forward-addr: <%= nms %> +<% end -%> + # This will actually only work starting with unbound 1.4.18 (wheezy has 1.4.17) + # previously, forward-first was not implemented for the root zone. + forward-first: yes +<% end -%>