From 88610faf0cea9931728a16bd7c19d932e0a10389 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 12 Nov 2019 13:47:13 +0100 Subject: [PATCH] Give the ability to change the negative cache ttl. --- library/roles/unbound-resolver/defaults/main.yml | 2 ++ library/roles/unbound-resolver/templates/unbound-server.conf | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/library/roles/unbound-resolver/defaults/main.yml b/library/roles/unbound-resolver/defaults/main.yml index 2ebb4d6..00eb531 100644 --- a/library/roles/unbound-resolver/defaults/main.yml +++ b/library/roles/unbound-resolver/defaults/main.yml @@ -30,6 +30,8 @@ unbound_so_reuseport: 'yes' unbound_outgoing_range: 8192 unbound_num_queries_per_thread: 4096 +unbound_max_negative_ttl: 3600 + # Stub zones # One of stub_host or stub_addr must be defined # stub_prime and stub_first are both optional, default 'yes' diff --git a/library/roles/unbound-resolver/templates/unbound-server.conf b/library/roles/unbound-resolver/templates/unbound-server.conf index 7216d8e..251d453 100644 --- a/library/roles/unbound-resolver/templates/unbound-server.conf +++ b/library/roles/unbound-resolver/templates/unbound-server.conf @@ -32,6 +32,9 @@ server: so-rcvbuf: {{ unbound_so_rcvbuf }} so-sndbuf: {{ unbound_so_sndbuf }} + # Negative TTL + cache-max-negative-ttl: {{ unbound_max_negative_ttl }} + # Faster UDP with multithreading (only on Linux). so-reuseport: {{ unbound_so_reuseport }} # with libevent @@ -52,7 +55,7 @@ stub-zone: {% if zone.stub_addr is defined %} stub-addr: {{ zone.stub_addr }} {% endif %} - stub-prime: {{ zone.stub_prime | default('yes') }} + stub-prime: {{ zone.stub_prime | default('no') }} stub-first: {{ zone.stub_first | default('yes') }} {% endfor %}