@@ -5,28 +5,40 @@ options {
55 listen-on { any; };
66 listen-on-v6 { any; };
77
8- // Not allowing recursion to prevent query leaks to the internet.
9- // This should be okay for Pebble because it only makes queries to the authoritative
10- // zone, but perhaps not for Boulder which will do e.g. CAA tree climbing.
11- // In the latter case, we might need to write an RPZ to do some local responses.
12- allow-recursion {
13- none;
14- };
15-
16- allow-transfer {
17- none;
18- };
19-
20- allow-update {
21- none;
22- };
8+ // We are allowing BIND to service recursive queries, but only in an extremely limimited sense
9+ // where it is entirely disconnected from public DNS:
10+ // - Iterative queries are disabled. Only forwarding to a non-existent forwarder.
11+ // - The only recursive answers we can get (that will not be a SERVFAIL) will come from the
12+ // RPZ "mock-recursion" zone. Effectively this means we are mocking out the entirety of
13+ // public DNS.
14+ allow-recursion { any; }; // BIND will only answer using RPZ if recursion is enabled
15+ forwarders { 192.0.2.254; }; // Nobody is listening, this is TEST-NET-1
16+ forward only; // Do NOT perform iterative queries from the root zone
17+ dnssec-validation no; // Do not bother fetching the root DNSKEY set (performance)
18+ response-policy { // All recursive queries will be served from here.
19+ zone "mock-recursion"
20+ log yes;
21+ } recursive-only no // Allow RPZs to affect authoritative zones too.
22+ qname-wait-recurse no // No real recursion.
23+ nsip-wait-recurse no; // No real recursion.
24+
25+ allow-transfer { none; };
26+ allow-update { none; };
2327};
2428
2529key "default-key." {
2630 algorithm hmac-sha512;
2731 secret "91CgOwzihr0nAVEHKFXJPQCbuBBbBI19Ks5VAweUXgbF40NWTD83naeg3c5y2MPdEiFRXnRLJxL6M+AfHCGLNw==";
2832};
2933
34+ zone "mock-recursion" {
35+ type primary;
36+ file "/var/lib/bind/rpz.mock-recursion";
37+ allow-query {
38+ none;
39+ };
40+ };
41+
3042zone "example.com." {
3143 type primary;
3244 file "/var/lib/bind/db.example.com";
0 commit comments