Date created: Monday, August 28, 2023 10:15:25 AM. Last modified: Friday, December 1, 2023 5:35:53 PM

Pi-hole

References:
https://docs.pi-hole.net/ftldns/dns-cache/
https://discourse.pi-hole.net/t/increase-ttl/25157/2

 

Cache

The default size is 10,000 entries.

You can not reduce the cache size below 150 when DNSSEC is enabled because the DNSSEC validation process uses the cache.

 

View cache status: https://pi.hole/admin/api.php?getCacheInfo

{
  "cacheinfo": {
    "cache-size": 10000,
    "cache-live-freed": 0,
    "cache-inserted": 36725,
    "ipv4": 62,
    "ipv6": 57,
    "srv": 2,
    "cname": 0,
    "ds": 338,
    "dnskey": 114,
    "other": 59,
    "expired": 245,
    "immortal": 70
  }
}

 

View cache insertions:

$ dig +short chaos txt insertions.bind @pi.hole
"36708"

 

View cache evictions (the number of cache entries that had to be removed although the corresponding entries were not expired):

$ dig +short chaos txt evictions.bind @pi.hole
"0"

 

DNS entries are only cached as long as their TTL specifies. One can force entries to have a minimum TTL (so that they are cached for longer) by adding the following setting:

$ cat /etc/dnsmasq.d/05-customadditions.con f

min-cache-ttl=2400

 

Maintenance

Upgrade Pi-hole:

docker-compose pull pihole
docker-compose down
docker-compose up -d

 

Clear Pi-hole logs:

# Inside the container CLI:
sudo service pihole-FTL stop
sudo rm /etc/pihole/pihole-FTL.db
sudo rm /var/log/pihole/pihole.log sudo service pihole-FTL start # From outside the container:
docker-compose exec pihole bash -c "\
service pihole-FTL stop && \
rm /etc/pihole/pihole-FTL.db && \
rm /var/log/pihole/pihole.log && \
service pihole-FTL start"

 

 


Previous page: OpenVSwitch with DPDK Install
Next page: Pound Proxy