[Dnsmasq-discuss] Caching issue question

Nick nick at double-stroke.com
Fri May 18 10:14:01 BST 2012


Hi,
I will provide a little bit more debug output. We are using Ubuntu 
11.10, so I rebuild the Ubuntu 12.04 package for Ubuntu 11.10.

Here is the current config which we use for dnsmasq (without defaults):

"""
domain-needed
resolv-file=/etc/dnsmasq.upstreams
strict-order
listen-address=127.0.0.1
no-dhcp-interface=127.0.0.1
bind-interfaces
no-hosts
cache-size=300
"""

Here is the log output of dnsmasq (syslog) when I do alternating 
queries with dig and enabled logging:

<restarted dnsmasq before to clear cache; TTL is 60 seconds; doing "dig 
session-storage.fd.corp" and "dig AAAA session-storage.fd.corp">
"""
May 18 12:08:05 pzk-node-9 dnsmasq[1367]: query[A] 
session-storage.fd.corp from 127.0.0.1
May 18 12:08:05 pzk-node-9 dnsmasq[1367]: forwarded 
session-storage.fd.corp to 10.193.3.133
May 18 12:08:05 pzk-node-9 dnsmasq[1367]: reply session-storage.fd.corp 
is <CNAME>
May 18 12:08:05 pzk-node-9 dnsmasq[1367]: reply cb-node-1.poz.fd.corp 
is 10.190.2.1

# now doing a AAAA request
May 18 12:08:08 pzk-node-9 dnsmasq[1367]: query[AAAA] 
session-storage.fd.corp from 127.0.0.1
May 18 12:08:08 pzk-node-9 dnsmasq[1367]: cached 
session-storage.fd.corp is <CNAME>
# why is CNAME cached for the first AAAA query?

May 18 12:08:08 pzk-node-9 dnsmasq[1367]: forwarded 
session-storage.fd.corp to 10.193.3.133
May 18 12:08:08 pzk-node-9 dnsmasq[1367]: reply session-storage.fd.corp 
is NODATA-IPv6

# now doing again A request
May 18 12:08:11 pzk-node-9 dnsmasq[1367]: query[A] 
session-storage.fd.corp from 127.0.0.1
May 18 12:08:11 pzk-node-9 dnsmasq[1367]: forwarded 
session-storage.fd.corp to 10.193.3.133
May 18 12:08:11 pzk-node-9 dnsmasq[1367]: reply session-storage.fd.corp 
is <CNAME>
May 18 12:08:11 pzk-node-9 dnsmasq[1367]: reply cb-node-1.poz.fd.corp 
is 10.190.2.1
# it got forwarded, but it should be in cache (first request was on 
12:08:05)

# doing same stuff again
May 18 12:08:14 pzk-node-9 dnsmasq[1367]: query[AAAA] 
session-storage.fd.corp from 127.0.0.1
May 18 12:08:14 pzk-node-9 dnsmasq[1367]: cached 
session-storage.fd.corp is <CNAME>
May 18 12:08:14 pzk-node-9 dnsmasq[1367]: forwarded 
session-storage.fd.corp to 10.193.3.133
May 18 12:08:14 pzk-node-9 dnsmasq[1367]: reply session-storage.fd.corp 
is NODATA-IPv6
May 18 12:08:17 pzk-node-9 dnsmasq[1367]: query[A] 
session-storage.fd.corp from 127.0.0.1
May 18 12:08:17 pzk-node-9 dnsmasq[1367]: forwarded 
session-storage.fd.corp to 10.193.3.133
May 18 12:08:17 pzk-node-9 dnsmasq[1367]: reply session-storage.fd.corp 
is <CNAME>
May 18 12:08:17 pzk-node-9 dnsmasq[1367]: reply cb-node-1.poz.fd.corp 
is 10.190.2.1
"""

I hope that helps.

Best Regards
Nick


Am 18.05.2012 10:35, schrieb Simon Kelley:
> On 18/05/12 09:14, Nick wrote:
>> Hi,
>> I have a question to the caching of dnsmasq. I installed dnsmasq on 
>> some
>> of our boxes and configured the boxes to use 127.0.0.1 in
>> /etc/resolv.conf (so they use dnsmasq). That works really well and I 
>> can
>> resolve DNS queries on those boxes. All the queries get send from
>> dnsmasq to our internal DNS server (which has internal zones
>> configured). For testing I checked the incoming DNS requests on the
>> central DNS server with the usage of "dnscap". I encountered a 
>> strange
>> thing:
>>
>> When I do a "dig session-storage.fd.corp" (fd.corp is an internal
>> domain) the first time on one box where dnsmasq is installed I can 
>> see
>> that one requests comes in on the central DNS server. The second 
>> time I
>> execute it, nothing comes in on the central DNS. So it gets cached 
>> in
>> dnsmasq which is fine. The problem appears when I do a "dig
>> session-storage.fd.corp" and a "dig AAAA session-storage.fd.corp"
>> alternately. I can see an incoming request for every dig request on 
>> the
>> central DNS server which means that there is no caching. I enabled
>> logging in dnsmasq and it seems that a request to the AAAA address
>> overwrites the cache entry for the A request. There is no AAAA entry 
>> on
>> our DNS server for session-storage.fd.corp (only an "A" entry is 
>> there
>> and this is a CNAME).
>>
>> So my question is if this is a normal behaviour of dnsmasq or a bug? 
>> I
>> have a php application which requests those A and AAAA names 
>> alternately
>> (this is how I recognized it).
>>
>> I am running dnsmasq 2.59 (the version from Ubuntu 12.04). Our 
>> central
>> DNS server uses powerdns.
>>
>>
> I just tried to reproduce this with the current code, and can't. I've
> created the domain
>
> test.thekelleys.org.uk
>
> which has A and AAAA records and 10-minute TTL and it gets cached 
> fine
> even when I alternate A and AAAA queries.
>
> So, to answer you question, it's certainly not intended behaviour, 
> and
> if it's a dnsmasq bug it's more complex than we currently know. Are 
> you
> sure the problem is not simply short time-to-live values?
>
> Are you using a custom dnsmasq config? The default
> launched-by-networkmanager dnsmasq install in Ubuntu precise disables
> caching.
>
>
> Cheers,
>
> Simon.
>
>
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss




More information about the Dnsmasq-discuss mailing list