brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: pihole-FTL --config database.maxDBdays sets how long queries are kept

Network and access
~/tips/tip-pihole-ftl-maxdbdays

sudo pihole-FTL --config database.maxDBdays 30

Controls for how many days Pi-hole keeps queries in its long-term database.

Pi-hole keeps a long-term history of your DNS queries, and the default is longer than I’d guess most people expect. If you’d rather keep a month, or nothing, it is one setting.

sudo pihole-FTL --config database.maxDBdays 30

According to the FTL docs, database.maxDBdays is how long queries are stored in the database, in days. The default is 91, and 0 disables the database altogether. In a Docker Compose file the same setting is FTLCONF_database_maxDBdays.

Next to it sits database.DBinterval, how often queries are written to the database. Its default is 60 seconds.

Two things to keep in mind. With 0 there is no database, so the long-term graphs and history have nothing to show. And the docs only describe the setting as the retention time. I haven’t seen them say what happens to older rows right after you lower the number, so don’t count on a quick cleanup of an existing file.

The docs list two more keys in the same section. database.DBimport says whether FTL loads information from the database on startup to know the most recent history, and it defaults to true. database.network.expire is how long IP addresses are kept in the network_addresses table, in days, also with a default of 91. The page documents only the write syntax of pihole-FTL --config, such as sudo pihole-FTL --config dns.dnssec true. To see the current value, the docs point you to /etc/pihole/pihole.toml.

Further reading: Pi-hole docs: FTL configuration

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link