From 743a5439b579f5e2878ad810a42d66600b44ffec Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 8 Jan 2021 19:47:34 +0100 Subject: [PATCH 1/3] Improve DNS cache documentation Signed-off-by: DL6ER --- docs/ftldns/dns-cache.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/ftldns/dns-cache.md b/docs/ftldns/dns-cache.md index 492bcf2..6871c25 100644 --- a/docs/ftldns/dns-cache.md +++ b/docs/ftldns/dns-cache.md @@ -1,15 +1,27 @@ `pihole-FTL` offers an efficient DNS cache that helps speed up your Internet experience. This DNS cache is part of the embedded `dnsmasq` server. Setting the cache size to zero disables caching. The DNS TTL value is used for determining the caching period. `pihole-FTL` clears its cache on receiving `SIGHUP`. + +!!! warning Some warning about enlarging the DNS cache size + **There is no benefit in enlarging this number *except* if the DNS cache evictions count is larger than zero.** In contrast, a larger cache *will* consume more memory on your node, leaving less memory available for other caches of your Pi-hole. If you push this number to the extremes, it may even be that your Pi-hole gets short on memory and does not operate as expected. + + ### Cache metrics The Settings page (System panel, FTL table) gives live information about the cache usage. It obtains its information from `http://pi.hole/admin/api.php?getCacheInfo`. #### DNS cache size -Size of the DNS domain cache, defaulting to 10,000 entries. You typically specify this number directly in `/etc/dnsmasq.d/01-pihole.conf`. It is the number of entries that can be actively cached at the same time. There is no benefit in enlarging this number *except* if the DNS cache evictions count is larger than zero. - +Size of the DNS domain cache, defaulting to 10,000 entries. It is the number of entries that can be actively cached at the same time. This information may also be queried using `dig +short chaos txt cachesize.bind` +The cache size is set in `/etc/dnsmasq.d/01-pihole.conf`. However, note that this setting does not survive Pi-hoel updates. If you want to change the cache size permanently, add a setting + +``` plain +CACHE_SIZE=12345 +``` + +in `/etc/pihole/setupVars.conf` and run `pihole -r` (Repair) to get the cache size changed for you automatically. + #### DNS cache insertions Number of total insertions into the cache. This number can be substantially larger than DNS cache size as expiring cache entries naturally make room for new insertions over time. Each lookup with a non-zero TTL will be cached. From 60fe21cb0cdf706430fc61086240abacf624dec3 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 8 Jan 2021 19:53:49 +0100 Subject: [PATCH 2/3] Also stress that the DNS cache cannot be disabled when using DNSSEC Signed-off-by: DL6ER --- docs/ftldns/dns-cache.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/ftldns/dns-cache.md b/docs/ftldns/dns-cache.md index 6871c25..b906b35 100644 --- a/docs/ftldns/dns-cache.md +++ b/docs/ftldns/dns-cache.md @@ -1,8 +1,10 @@ `pihole-FTL` offers an efficient DNS cache that helps speed up your Internet experience. This DNS cache is part of the embedded `dnsmasq` server. Setting the cache size to zero disables caching. The DNS TTL value is used for determining the caching period. `pihole-FTL` clears its cache on receiving `SIGHUP`. -!!! warning Some warning about enlarging the DNS cache size +!!! warning Some warning about the DNS cache size **There is no benefit in enlarging this number *except* if the DNS cache evictions count is larger than zero.** In contrast, a larger cache *will* consume more memory on your node, leaving less memory available for other caches of your Pi-hole. If you push this number to the extremes, it may even be that your Pi-hole gets short on memory and does not operate as expected. + + Also, note that, because the DNSSEC validation process uses the cache, it is not permitted to reduce the cache size below `150` when DNSSEC is enabled. ### Cache metrics From 8c634012e77a51cc7a57a3ca145788de89b70600 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 9 Jan 2021 07:53:48 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Signed-off-by: DL6ER Co-authored-by: Dan Schaper --- docs/ftldns/dns-cache.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/ftldns/dns-cache.md b/docs/ftldns/dns-cache.md index b906b35..d078973 100644 --- a/docs/ftldns/dns-cache.md +++ b/docs/ftldns/dns-cache.md @@ -2,9 +2,11 @@ !!! warning Some warning about the DNS cache size - **There is no benefit in enlarging this number *except* if the DNS cache evictions count is larger than zero.** In contrast, a larger cache *will* consume more memory on your node, leaving less memory available for other caches of your Pi-hole. If you push this number to the extremes, it may even be that your Pi-hole gets short on memory and does not operate as expected. + **There is no benefit in increasing this number *unless* the number of DNS cache evictions is greater than zero.** - Also, note that, because the DNSSEC validation process uses the cache, it is not permitted to reduce the cache size below `150` when DNSSEC is enabled. + A larger cache *will* consume more memory on your node, leaving less memory available for other caches of your Pi-hole. If you push this number to the extremes, it may even be that your Pi-hole gets short on memory and does not operate as expected. + + You can not reduce the cache size below `150` when DNSSEC is enabled because the DNSSEC validation process uses the cache. ### Cache metrics @@ -16,7 +18,7 @@ The Settings page (System panel, FTL table) gives live information about the cac Size of the DNS domain cache, defaulting to 10,000 entries. It is the number of entries that can be actively cached at the same time. This information may also be queried using `dig +short chaos txt cachesize.bind` -The cache size is set in `/etc/dnsmasq.d/01-pihole.conf`. However, note that this setting does not survive Pi-hoel updates. If you want to change the cache size permanently, add a setting +The cache size is set in `/etc/dnsmasq.d/01-pihole.conf`. However, note that this setting does not survive Pi-hole updates. If you want to change the cache size permanently, add a setting ``` plain CACHE_SIZE=12345