<div dir="ltr">Hello!<div><br></div><div>We are using dnsmasq for local DNS caching on all our hosts.</div><div><br></div><div>We've set up a custom upstream domain to route DNS requests for Consul to the local Consul agent, using this config directive:</div><div><br></div><div><font face="monospace">server=/consul/<a href="http://127.0.0.1#8600">127.0.0.1#8600</a></font><br></div><div><br></div><div>Looking at the load the Consul agent, we were suspecting that dnsmasq was not caching the replies from Consul.  After enabling query logging on dnsmasq, it looks like this is the case.</div><div><br></div><div>If I query any other domain repeatedly, (eg. <a href="http://example.com">example.com</a>, <a href="http://google.com">google.com</a>), it logs that it's using the cache:</div><div><br></div><div><div><font face="monospace">Jul 12 13:56:56 ip-10-184-50-103 dnsmasq[18119]: query[A] <a href="http://www.google.ca">www.google.ca</a> from 127.0.0.1</font></div><div><font face="monospace">Jul 12 13:56:56 ip-10-184-50-103 dnsmasq[18119]: cached <a href="http://www.google.ca">www.google.ca</a> is 172.217.5.227</font></div></div><div><font face="monospace">... repeats ...</font></div><div><br></div><div>If I query a Consul domain repeatedly, it doesn't seem to use the cache:</div><div><br></div><div><div><font face="monospace">Jul 12 13:57:55 ip-10-184-50-103 dnsmasq[18119]: query[A] consul.service.consul from 127.0.0.1</font></div><div><font face="monospace">Jul 12 13:57:55 ip-10-184-50-103 dnsmasq[18119]: forwarded consul.service.consul to 127.0.0.1</font></div><div><font face="monospace">Jul 12 13:57:55 ip-10-184-50-103 dnsmasq[18119]: reply consul.service.consul is 10.144.40.2</font></div><div><font face="monospace">Jul 12 13:57:55 ip-10-184-50-103 dnsmasq[18119]: reply consul.service.consul is 10.51.148.85</font></div><div><font face="monospace">Jul 12 13:57:55 ip-10-184-50-103 dnsmasq[18119]: reply consul.service.consul is 10.37.226.205</font></div><div><font face="monospace">... repeats ...</font></div></div><div><font face="monospace"><br></font></div><div>I've searched for any documentation regarding caching behavior for custom upstream domains and I haven't found anything.</div><div><br></div><div>Any ideas?</div><div><br></div><div>Thanks,</div><div>Paulo</div></div>