Discussion:
[Dnsmasq-discuss] Should results from --server be cached?
Michael Tolan
2018-03-12 17:53:29 UTC
Permalink
Hi all,

I want to ask whether queries for A records matching a --server argument
are expected to be cached. I'm running an instance of dnsmasq with the
following arguments:

dnsmasq -k --all-servers --cache-size=10000 --log-facility=-
--server=/cluster.local/127.0.0.1#10053 --server=/in-addr.arpa/
127.0.0.1#10053 --server=/in6.arpa/127.0.0.1#10053 --dns-forward-max=2048
--log-queries --no-negcache

I would expect when it receives a query for a domain name matching
.cluster.local, that dnsmasq would forward the request to the specified
nameserver (127.0.0.1#10053) and that it would cache the response for the
duration of the TTL that the 127.0.0.1#10053 nameserver specifies.

The behavior I'm obsering is that when requests are made for a
cluster.local domain, they are always forwarded to the 127.0.0.1#10053
nameserver.

Cache insertion metrics lead me to believe that response records are being
inserted into the cache, however, subsequent requests for the same
cluster.local address aren't actually served from the cache.

So my question is, am I misunderstanding the behavior of the --server
arugment as it relates to populating the cache? Or is it possible that
dnsmasq is forwarding the query prior to checking whether the requested
value already exists in the cache?

Thanks very much,
-Michael
Simon Kelley
2018-03-15 17:09:46 UTC
Permalink
Yes, they should be cached. The dnsmasq --log-queries option will tell
you when or not a particular answer comes from the cache, which should
give you confidence about what's happening in this case.


Cheers,

Simon.
Post by Michael Tolan
Hi all,
I want to ask whether queries for A records matching a --server argument
are expected to be cached. I'm running an instance of dnsmasq with the
dnsmasq -k --all-servers --cache-size=10000 --log-facility=-
--server=/cluster.local/127.0.0.1#10053 <http://127.0.0.1#10053>
--server=/in-addr.arpa/127.0.0.1#10053 <http://127.0.0.1#10053>
--server=/in6.arpa/127.0.0.1#10053 <http://127.0.0.1#10053>
--dns-forward-max=2048 --log-queries --no-negcache
I would expect when it receives a query for a domain name matching
.cluster.local, that dnsmasq would forward the request to the specified
nameserver (127.0.0.1#10053) and that it would cache the response for
the duration of the TTL that the 127.0.0.1#10053 nameserver specifies. 
The behavior I'm obsering is that when requests are made for a
cluster.local domain, they are always forwarded to the 127.0.0.1#10053
nameserver. 
Cache insertion metrics lead me to believe that response records are
being inserted into the cache, however, subsequent requests for the same
cluster.local address aren't actually served from the cache.
So my question is, am I misunderstanding the behavior of the --server
arugment as it relates to populating the cache? Or is it possible that
dnsmasq is forwarding the query prior to checking whether the requested
value already exists in the cache?
Thanks very much,
-Michael
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
Loading...