Limit Pihole database in container

Hi folks,
My Pihole runs on a Synology, formerly in Docker, now in Container Manager. I have noticed that the database is getting bigger and bigger, where exactly do I limit this to a certain period of time?
There are instructions on how to do this, but how does it work in a container?


Note that an excessively growing database may be an indication of a misconfiguration like a full or partial DNS loop, which would amplify the number of DNS requests out of proportion.

You should verify that isn't the case before adjusting Pi-hole's retention thresholds.

If you've ruled that out:
You may have missed our docs on Pi-hole Docker's Advanced Variables:

Variable Default Value Description
FTLCONF_[SETTING] unset As per documentation Customize pihole-FTL.conf with settings described in the FTLDNS Configuration page. For example, to customize LOCAL_IPV4, ensure you have the FTLCONF_LOCAL_IPV4 environment variable set.

You want to try applying MAXDBDAYS in that way.

Thank you for your answer!
I don't even know how to detect a misconfiguration. Adverts are successfully blocked.

Is it sufficient to add the value MAXDBDAYS=365 with a text editor?
Which file do I use, the pihole-FTL.conf or the 01-pihole.conf which is stored under dnsmasq.d?

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

Your debug log shows Pi-hole's Conditional Forwarding to be enabled.
This could close a partial DNS loop if your router would use Pi-hole as its upstream, amplifying the amount of DNS requests.

In addition, it shows your Pi-hole to use another DNS resolver on the same IP as Pi-hole, but listening on a different port.
Any requests that that upstream resolver at 51553 would forward to Pi-hole would also close a loop.

As your query database size of over 1 GB is on the larger end, you may want to scrutinise your most active clients and most requested domains.

The following commands may reveal overly active clients or excessively requested domains. They need to be run from inside your Pi-hole container:

echo ">stats >quit" | nc localhost 4711
echo ">top-clients >quit" | nc localhost 4711
echo ">top-domains >quit" | nc localhost 4711
echo ">top-ads >quit" | nc localhost 4711

Where do I execute these commands? My PI Hole runs in a container on my Synology.

I created the pihole plus an unbound server with a tutorial.

I had changed something and then imported an old backup.

There was an update in my Synology, the container programme is no longer called Docker but Container Manager. You can also update PiHole in this programme, but I don't know if that's a good idea.