[Dnsmasq-discuss] Dnsmasq does not cache a authoritative response from upstream ?

Akash akbwiz+dnsmasq at gmail.com
Wed Oct 14 23:35:13 BST 2015


> So, you're saying that an AA bit in an answer stops dnsmasq from
> caching that answer? It's no-trivial for me to test that just now, but
> I'm not aware of any reason why dnsmasq should behave in that way, and
> A quick grep of the code shows no obvious use of the AA flag to do
> _anything_ to do with caching.

Yes that is what I meant. Its easy to test. When you run this command:

root at noname:~# dnsmasq -h -R -d -q -S 8.8.8.8

and query the server running above command for yahoo.com, you see the 
following output. As 8.8.8.8 is not authoritative for yahoo.com, dnsmasq 
is caching the results:

dnsmasq: started, version 2.62 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 
no-Lua TFTP conntrack
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: cleared cache
dnsmasq: query[A] yahoo.com from 67.222.132.211
dnsmasq: forwarded yahoo.com to 8.8.8.8
dnsmasq: reply yahoo.com is 206.190.36.45
dnsmasq: reply yahoo.com is 98.138.253.109
dnsmasq: reply yahoo.com is 98.139.183.24
dnsmasq: query[A] yahoo.com from 67.222.132.211
dnsmasq: cached yahoo.com is 98.139.183.24
dnsmasq: cached yahoo.com is 98.138.253.109
dnsmasq: cached yahoo.com is 206.190.36.45
dnsmasq: query[A] yahoo.com from 67.222.132.211
dnsmasq: cached yahoo.com is 206.190.36.45
dnsmasq: cached yahoo.com is 98.139.183.24
dnsmasq: cached yahoo.com is 98.138.253.109

Running same command but instead of 8.8.8.8 using 119.160.247.124 now 
which is authoritative for yahoo.com:

root at noname:~# dnsmasq -h -R -d -q -S 119.160.247.124

when queries are sent again for yahoo.com, they are always forwarded and 
not cached:

dnsmasq: started, version 2.62 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 
no-Lua TFTP conntrack
dnsmasq: using nameserver 119.160.247.124#53
dnsmasq: cleared cache
dnsmasq: query[NS] yahoo.com from 67.222.132.211
dnsmasq: forwarded yahoo.com to 119.160.247.124
dnsmasq: query[A] yahoo.com from 67.222.132.211
dnsmasq: forwarded yahoo.com to 119.160.247.124
dnsmasq: reply yahoo.com is 98.139.183.24
dnsmasq: reply yahoo.com is 98.138.253.109
dnsmasq: reply yahoo.com is 206.190.36.45
dnsmasq: query[A] yahoo.com from 67.222.132.211
dnsmasq: forwarded yahoo.com to 119.160.247.124
dnsmasq: reply yahoo.com is 98.138.253.109
dnsmasq: reply yahoo.com is 206.190.36.45
dnsmasq: reply yahoo.com is 98.139.183.24
dnsmasq: query[A] yahoo.com from 67.222.132.211
dnsmasq: forwarded yahoo.com to 119.160.247.124
dnsmasq: reply yahoo.com is 98.138.253.109
dnsmasq: reply yahoo.com is 206.190.36.45
dnsmasq: reply yahoo.com is 98.139.183.24

-Akash




More information about the Dnsmasq-discuss mailing list