DNS Cache behavior, missed cache hits
Router: ER707-M2 v1.0 1.2.1
Controller: OC200 2.0 5.13.30.20
DNS Proxy: Enable
Proxy Type: DoH NextDNS
DNS Cache: Enable
TTL: 90 seconds
I'm trying to understand the DNS Cache behavior I am observing.
I have a container running UptimeKuma polling the router DNS every 60 seconds by requesting google.com which should be an extremely common domain I would expect to almost always be in the cache. Well, it should absolutely be in the cache is the polling is every 60 seconds but the TTL exceeds that at 90 seconds. Unless the cache is being flushed within that 60 second polling window.
When cache is OFF the router DNS response is ~24ms. Immediately after turning the cache on the router DNS response is ~1ms which seems to support the cache is working as intended and getting matching cache hits. So far so good.
However, after some amount of time, definitely less than 24 hours, the cache seems to stop working properly and every other poll seems to miss a cache hit based on the reported response times. It could be that the cache table has reached capacity and is being flushed. But my controller has exactly 0 logging related to the cache behavior. Even if that were the case I wouldn't expect it to appear to reliably flip-flop like this and during some extended periods it would happen to retain the cache. Particularly since google.com is such an active domain.
At the time I write this my DNS Cache table has less than 100 records total. With a 90 second TTL they expire reasonably quickly.
I am using a DNS proxy setup using DoH NextDNS. I have another monitor making the same DNS request for google.com but bypassing the router and directly accessing the NextDNS server directly by IP and that specific server has an average response of ~10ms. The summary says "ping" but it's a DNS lookup and you can see some of the historical IP resolution in the table below the chart. This isn't necessarily the same server the DNS Proxy is always using as the proxy is setup using a hostname not IP. But it's a datapoint for comparison and I mostly provide it here to illustrate any non-cache lookup by my router cannot be any faster than the response time from NextDNS.
Honestly, I just enabled this as an experiment to see how it performed. As a human I certainly don't notice any performance difference between 1ms and 24ms DNS lookups. So I can certainly continue to live without this feature like I was before DNS Cache was made available.
Thoughts?
Is there some additional logging available that would help me understand how the DNS cache is being handled?