X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Funbound%2Ftemplates%2Funbound.conf.erb;h=a8001903e6f558f99a54b2ac5f84886a453029fb;hb=146cc9cdb25153a49c3923710ca598bd939328b4;hp=07f3ca2a6e963b80b01bb96c3d80a0de74229078;hpb=b605115fde737dc5e82ce6d66e878bd7d5f00d03;p=mirror%2Fdsa-puppet.git diff --git a/modules/unbound/templates/unbound.conf.erb b/modules/unbound/templates/unbound.conf.erb index 07f3ca2a6..a8001903e 100644 --- a/modules/unbound/templates/unbound.conf.erb +++ b/modules/unbound/templates/unbound.conf.erb @@ -6,34 +6,28 @@ server: verbosity: 1 -<%= - out = [] - if nodeinfo['misc']['resolver-recursive'] and 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" - 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: "" hide-identity: yes hide-version: yes - use-caps-for-id: yes - # Do not query the following addresses. No DNS queries are sent there. # List one address per entry. List classless netblocks with /size, # do-not-query-address: 127.0.0.1/8 @@ -50,17 +44,23 @@ server: auto-trust-anchor-file: "/var/lib/unbound/root.key" auto-trust-anchor-file: "/var/lib/unbound/debian.org.key" -<%= - out = [] - if not nodeinfo['misc']['resolver-recursive'] and not nodeinfo['hoster']['nameservers_break_dnssec'] - forwarders = nodeinfo['hoster']['nameservers'] - forwarders ||= [] - - out << 'forward-zone:' - out << ' name: "."' - forwarders.each do |ns| - out << " forward-addr: #{ns}" - end - end - 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 -%> +# XXX : we probably ought to forward 172.29 reverse queries to our nameserver +# if our forwarders are not ours. +<% else -%> +forward-zone: + name: "29.172.in-addr.arpa" + forward-host: ns1.debian.org + forward-host: ns2.debian.org + forward-host: ns3.debian.org + forward-host: ns4.debian.com +<% end -%> +<% if hostname == "zappa" -%> +edns-buffer-size: 512 +<% end -%>