As DL6ER has explained, it's unlikely that Pi-hole would cease using shm.
Limiting shm to a certain size (if possible) could perhaps be an option that would benefit other users as well, but that is for development to decide.
Meanwhile, I've tried to provide you with a solution that would work immediately and also lower DNS requests, independently of Pi-hole.
It may help to understand that DNS addresses the balance between most up-to-date information for clients and server load by providing a TTL in DNS replies.
Pi-hole allows to tune TTLs for records its authoritative for, by setting pihole-FTL's BLOCK_TTL
or dnsmasq's local-ttl
.
Most OSs would come with a caching DNS resolver, which would mitigate clients excessive requests by honoring those TTLs.
Your client OSs apparently don't, which is why you observe those excessive DNS requests.
Installing a stub resolver on the clients would address your issue, and substantially lower DNS requests at the same time.
That solution is not only available immediately, it is also superior to only having Pi-hole somehow hide or ignore the requests.
EDIT:
DNS may just paper-gloss over client application behaviour here:
That seems like an unfavourable implementation choice by the application software that makes those calls.
If you have control over those applications, there are likely ways to improve the code.
For once, the domain could be resolved to an IP and held in a variable prior to database access, so actual subsequent calls can operate with that IP variable. If multiple calls are made in one transaction, that would already lower the number of calls. Potentially, similar could be applied to longer living sessions as well.
But an even bigger benefit would be to make use of database connection pooling, allowing calls to reuse existing connections, even across sessions. This would avoid the overhead of authenticating against a database and negotiating a connection for every single database call.
While those improvements would significantly lower the number of DNS requests, they'd likely also reduce resource usage (cpu, ram, network) and thus boost application performance - perhaps considerably, given the large number of your requests.