[Dnsmasq-discuss] When multiple CNAMEs are mapped to same domain, then some of the CNAME entries becomes outdated.

Simon Kelley simon at thekelleys.org.uk
Wed Sep 12 11:36:53 BST 2012


On 12/09/12 04:28, Atul Gupta wrote:
> I am seeing the following issues with the DNSMASQ:
> 
> When multiple CNAMEs are mapped to a single domain then the code seems
> to update the domain in the cache multiple times causing the UID to be
> updated. When the CNAMEs are requested next time although they are in
> the cache, it is marked as outdated (because of the UID mismatch)
> triggering the DNSMASQ to forward the query back up to the server.
> 
> I fixed the issue by
> checking the cache before the "cache_insert" is invoked from the
> function "extract_addresses".
> 
> Has anyone faced similar issue? 

It's real, and I'm pretty sure that when the CNAME stuff was added, it
was accepted as a trade-off, after all, it doesn't generate wrong
answers, just operates in a non-optimal manner for a small subset of
queries.

Is the fix ok?

The reason for doing the full delete-reinsert cycle is to make sure that
the data in the cache reflects exactly and only the data in the current
reply.

Assume you have a reply which looks like


A is CNAME for B
B is A 1.2.3.4

but B already exists in the cache with multiple A values, one of which
is 1.2.3.4

Just looking up B, will either produce one of the wrong values (Now what
do you do?) or 1.2.3.4. Not doing delete-an-reinsert leaves the other
values in the cache.

It could be argued that this is covering up for upstream wierdness, but
not doing so would worry me.

I think the correct solution is to introduce a new "free cache entry"
state which preserves the name and the uid, so these can be restored in
necessary.

The whole cache system has grown to be rather baroque, but it should be
possible to do something.

Cheers,

Simon.

> 
> Atul.
>    
> 




More information about the Dnsmasq-discuss mailing list