Skip to content

Commit

Permalink
update role with saner defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasberens committed Aug 9, 2024
1 parent e905405 commit cd047cb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion roles/bind/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Restart bind
ansible.builtin.service:
name: bind
name: named
enabled: true
state: restarted
1 change: 1 addition & 0 deletions roles/bind/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
name:
- bind9
- prometheus-bind-exporter
- bind9-dnsutils
state: present
update_cache: true
notify:
Expand Down
32 changes: 27 additions & 5 deletions roles/bind/templates/named.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,35 @@
options {
directory "/var/cache/bind";
dnssec-validation auto;
listen-on-v6 { ::1; };
listen-on { 127.0.0.1; };
recursion no;
allow-transfer { none; };

auth-nxdomain no; // conform to RFC1035
listen-on-v6 { any; };
listen-on { any; };

// Rate Limiting: https://kb.isc.org/docs/bind-best-practices-authoritative

rate-limit {
slip 2; // Every other response truncated
window 15; // Seconds to bucket
responses-per-second 5;// # of good responses per prefix-length/sec
referrals-per-second 5; // referral responses
nodata-per-second 5; // nodata responses
nxdomains-per-second 5; // nxdomain responses
errors-per-second 5; // error responses
all-per-second 20; // When we drop all
log-only yes; // Debugging mode
qps-scale 250; // x / 1000 * per-second
// = new drop limit
exempt-clients { 127.0.0.1; };
ipv4-prefix-length 24; // Define the IPv4 block size
ipv6-prefix-length 56; // Define the IPv6 block size
max-table-size 20000; // 40 bytes * this number = max memory
min-table-size 500; // pre-allocate to speed startup
};
};

//
// Do any local configuration here
//


// prime the server with knowledge of the root servers
Expand Down

0 comments on commit cd047cb

Please sign in to comment.