no RRL on the primary
[mirror/dsa-puppet.git] / modules / named / templates / named.conf.options.erb
index 5dec7ba..1db5200 100644 (file)
@@ -6,9 +6,9 @@
 acl Nagios {
 <%=
   str = ''
-  localinfo.keys.sort.each do |node|
-      if localinfo[node]['nagiosmaster']
-          keyinfo[node][0]['ipHostNumber'].each do |ip|
+  scope.lookupvar('site::localinfo').keys.sort.each do |node|
+      if scope.lookupvar('site::localinfo')[node]['nagiosmaster']
+          scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |ip|
               str += "\t" + ip + "/32;\n"
           end
       end
@@ -17,43 +17,51 @@ acl Nagios {
 };
 
 options {
-        directory "/var/cache/bind";
+       directory "/var/cache/bind";
 
-        auth-nxdomain no;    # conform to RFC1035
-        listen-on-v6 { any; };
+       auth-nxdomain no;    # conform to RFC1035
+       listen-on { ! 127.0.0.1; any; };
+       listen-on-v6 { ! ::1; any; };
 
-        allow-transfer { none; };
-        allow-update { none; };
-<%= if classes.include?('named::geodns') -%>
-        blackhole { 192.168.0.0/16; 10.0.0.0/8; 172.16.0.0/12; };
-<%= end -%>
+       allow-transfer { none; };
+       allow-update { none; };
+<% if classes.include?("named::geodns") -%>
+       blackhole { 192.168.0.0/16; 10.0.0.0/8; 172.16.0.0/12; };
+<% end -%>
 
 <%=
   allowed='Nagios; '
-  if classes.include?('named::secondary')
-    allowed += 'localnets; '
-  end
 
-  str =  "allow-recursion { " + allowed + " };\n"
-  str += "allow-query { " + allowed + " };\n"
+  str =  "\tallow-recursion { " + allowed + " };\n"
+  str += "\tallow-query { " + allowed + " };\n"
 
   str
 -%>
 
-<%= if classes.include?('named::secondary') -%>
+<% if classes.include?('named::authoritative') or classes.include?('named::geodns') -%>
        dnssec-enable yes;
        dnssec-validation yes;
-<%= end -%>
+<% end -%>
+
+<% if classes.include?('named::authoritative') and not classes.include?('named::primary') -%>
+       rate-limit {
+               responses-per-second 25;
+               window 5;
+               slip 5;
+               qps-scale 250;
+       };
+<% end -%>
+
 };
 
 logging {
 
        channel queries {
-<%= if classes.include?('named::geodns') -%>
+<% if classes.include?('named::geodns') -%>
                file "/var/log/bind9/geoip-query.log" versions 4 size 40m;
-<%= else -%>
+<% else -%>
                file "/var/log/bind9/named-query.log" versions 4 size 40m;
-<%= end -%>
+<% end -%>
                print-time yes;
                print-category yes;
        };
@@ -61,3 +69,7 @@ logging {
        category lame-servers { null; };
 };
 
+<% if classes.include?('named::authoritative') -%>
+include "/etc/bind/named.conf.puppet-shared-keys";
+<% end -%>