On 08/01/2025 21:34, Gilad Moav wrote:
another weird one: just did a quick `dig tcp3.sub.mov.lat +tcp` which only has 1 A RR. it successfully resolved and forwarded, but it doesn't show in the cache.

What release are you testing? Releases before 2.81 didn't insert RRs from TCP queries into the cache.

The query above caches for me, but the TTL is only 30s, which might also have confused your test. 30s is the upper bound on how long dnsmasq will cache the answer. If the upstream recursive server has had the data for, say, 28s then dnsmasq will only cache it for the remaining 2s of the TTL.


Cheers,

Simon.

    Hi, I wanted to share an observation regarding Dnsmasq's cache
    behavior that might warrant attention.

    It seems that if a DNS response exceeds the configured cache size,
    issuing a new DNS request causes Dnsmasq to flush its entire cache.

    This behavior is easily reproducible:

    1. Request a DNS resolution for kong.sub.mov.lat (ensuring you're
    using EDNS with the truncation flag, or DNS over TCP).
    2. After the response, request the resolution of any other domain.

    Upon doing so, the entire cache is wiped, leaving only the latest
    response in the cache.

     From what I’ve gathered, it appears that all entries related to the
    oversized response are treated as a single entity within the cache.
    When a new response is cached, instead of freeing just enough space
    for the new entry, the system flushes the entire cache.

    Please let me know your thoughts on this or if further clarification
    is needed.

    Best regards,
    Gilad.


_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss


_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to