<div class="gmail_quote">I am seeing the following issues with the DNSMASQ:<br>
<br>
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.<br>

<br>
For example:<br>
<br>
Host                                                        Address                                                 Flags     Expires<br>
<a href="http://india.blogs.nytimes.com" target="_blank">india.blogs.nytimes.com</a>                                                                                     CF         Fri Sep 14 13:25:24 2012<br>
<a href="http://cityroom.blogs.nytimes.com" target="_blank">cityroom.blogs.nytimes.com</a>                                                                              CF         Fri Sep 14 13:25:17 2012<br>
<a href="http://mediadecoder.blogs.nytimes.com" target="_blank">mediadecoder.blogs.nytimes.com</a>                                                                    CF         Fri Sep 14 13:25:23 2012<br>
<a href="http://afterdeadline.blogs.nytimes.com" target="_blank">afterdeadline.blogs.nytimes.com</a>                                                                      CF         Fri Sep 14 13:25:18 2012<br>
<a href="http://opinionator.blogs.nytimes.com" target="_blank">opinionator.blogs.nytimes.com</a>                                                                         CF         Fri Sep 14 13:25:18 2012<br>
<a href="http://well.blogs.nytimes.com" target="_blank">well.blogs.nytimes.com</a>                                                                                       CF         Fri Sep 14 13:25:22 2012<br>
<a href="http://publiceditor.blogs.nytimes.com" target="_blank">publiceditor.blogs.nytimes.com</a>                                                                        CF         Fri Sep 14 13:25:18 2012<br>
<a href="http://dealbook.nytimes.com" target="_blank">dealbook.nytimes.com</a>                        <a href="http://dealbook.blogs.nytimes.com" target="_blank">dealbook.blogs.nytimes.com</a>             CF         Fri Sep 14 13:25:10 2012<br>

<a href="http://takingnote.blogs.nytimes.com" target="_blank">takingnote.blogs.nytimes.com</a>           <a href="http://blog.nytimes.com" target="_blank">blog.nytimes.com</a>                                 CF         Fri Sep 14 13:25:24 2012<br>

<a href="http://rendezvous.blogs.nytimes.com" target="_blank">rendezvous.blogs.nytimes.com</a>                                                                         CF         Fri Sep 14 13:25:24 2012<br>
<a href="http://tmagazine.blogs.nytimes.com" target="_blank">tmagazine.blogs.nytimes.com</a>                                                                            CF         Fri Sep 14 13:25:24 2012<br>
<a href="http://campaignstops.blogs.nytimes.com" target="_blank">campaignstops.blogs.nytimes.com</a>                                                                    CF         Fri Sep 14 13:25:18 2012<br>
<a href="http://dealbook.blogs.nytimes.com" target="_blank">dealbook.blogs.nytimes.com</a>             <a href="http://blog.nytimes.com" target="_blank">blog.nytimes.com</a>                                 CF         Fri Sep 14 13:25:10 2012<br>

<a href="http://runway.blogs.nytimes.com" target="_blank">runway.blogs.nytimes.com</a>                                                                                CF         Fri Sep 14 13:25:23 2012<br>
<a href="http://lens.blogs.nytimes.com" target="_blank">lens.blogs.nytimes.com</a>                                                                                       CF         Fri Sep 14 13:25:11 2012<br>
<a href="http://artsbeat.blogs.nytimes.com" target="_blank">artsbeat.blogs.nytimes.com</a>                                                                               CF         Fri Sep 14 13:25:23 2012<br>
<a href="http://krugman.blogs.nytimes.com" target="_blank">krugman.blogs.nytimes.com</a>                                                                              CF         Fri Sep 14 13:25:24 2012<br>
<a href="http://blog.nytimes.com" target="_blank">blog.nytimes.com</a>                                 170.149.168.153                                 4F         Fri Sep 14 13:25:24 2012<br>
<a href="http://blog.nytimes.com" target="_blank">blog.nytimes.com</a>                                                                                                 6F   N     Fri Sep 14 13:25:10 2012<br>
<br>
In this example when on receiving any one of the CNAME domains query from the client PC, the DNSMASQ resends the query to the server because the entry in the cache is deemed as outdated. I fixed the issue by checking the cache before the "cache_insert" is invoked from the function "extract_addresses".<br>

<br>Has anyone faced similar issue? Is the fix ok?<br><br>
Atul.<br>
    </div><br>