[Dnsmasq-discuss] Can't get caching to work consistently for external clients

sirquijote at lavabit.com sirquijote at lavabit.com
Mon Jul 29 01:25:13 BST 2013


Hi,

Debian 7 "Wheezy"; DNSmasq 2.62-3+deb7u1; external clients are Macs
running OS X 10.8+

I set up DNSmasq several times recently, and after testing on the server
and the clients it would seem to be working just fine.  The test I would
run is, "dig debian.org".  The results on the server would be an initial
50ms lookup, followed by 0ms on subsequent lookups.  On the Mac clients,
the initial was the same with subsequent being about 6ms.  I would run the
lookups several times just to make sure it was working consistently.

24 hours later, however, I run the same test to find the Macs returning
times of 45-50ms 9 times out of 10, with the occasional 1 in 10 returning
0ms.  On those latter occasions, dig takes up to 5 seconds to produce the
output of the command, whereas on the other occasions it's instantaneous. 
During the initial, post-setup testing, when the cached results were
consistently returned, dig would return the cached results
instantaneously.  So, there's something strange going on for me.  I should
add that running "dig debian.org" on the server still works fine, and
produces 0ms times each time - it's just the external clients that are
affected.  I should also add that I have made no changes to the server
during this time.

The uncommented commands in DNSmasq's config file are as follows:

[CONFIG BEGINS]
domain-needed
bogus-priv
resolv-file=/etc/resolv.dnsmasq
strict-order
no-poll
interface=eth0
no-dhcp-interface=eth0
log-facility=/media/usb/log/dnsmasq
## The following redirects foreign TV requests to Tunlr's DNS servers:
server=/mtv.com/mtvnservices.com/fwmrm.net/google-analytics.com/imrworldwide.com/demdex.net/scorecardresearch.com/quantserve.com/doubleclick.net/chartbeat.com/192.95.16.109
server=/mtv.com/mtvnservices.com/fwmrm.net/google-analytics.com/imrworldwide.com/demdex.net/scorecardresearch.com/quantserve.com/doubleclick.net/chartbeat.com/142.54.177.158
server=/fox.com/theplatform.com/akamaihd.net/chartbeat.com/192.95.16.109
server=/fox.com/theplatform.com/akamaihd.net/chartbeat.com/142.54.177.158
server=/tunlr.net/192.95.16.109
server=/tunlr.net/142.54.177.158
server=/hulu.com/192.95.16.109
server=/hulu.com/142.54.177.158
server=/cbs.com/192.95.16.109
server=/cbs.com/142.54.177.158
server=/abc.com/go.com/192.95.16.109
server=/abc.com/go.com/142.54.177.158
server=/tv.com/192.95.16.109
server=/tv.com/142.54.177.158
server=/pbs.com/192.95.16.109
server=/pbs.com/142.54.177.158
server=/thewb.com/192.95.16.109
server=/thewb.com/142.54.177.158
server=/cwtv.com/192.95.16.109
server=/cwtv.com/142.54.177.158
server=/mylifetime.com/scorecardresearch.com/doubleclick.net/rubiconproject.com/cpxinteractive.com/adnxs.com/brightcove.com/cpxadroit.com/atdmt.com/serving-sys.com/192.95.16.109
server=/mylifetime.com/scorecardresearch.com/doubleclick.net/rubiconproject.com/cpxinteractive.com/adnxs.com/brightcove.com/cpxadroit.com/atdmt.com/serving-sys.com/142.54.177.158
server=/cbc.ca/192.95.16.109
server=/cbc.ca/142.54.177.158
[CONFIG ENDS]

As per your advice I have changed the default resolv.conf file to point to
127.0.0.1, and set up a new resolvconf.dnsmasq file just for DNSmasq,
containing two nameserver entries.  I've changed the DNS on my Mac clients
to the IP of my DNSmasq server.

There is one other thing that may be related: my resolv.conf file's
contents keep getting periodically re-written to point exclusively to my
network's router.  I'm not sure why this occurs, but perhaps it's related?
I've removed write permissions from that file until I can figure out how
to fix it properly.

Hopefully someone can help.  Thanks in advance.

SQ.





More information about the Dnsmasq-discuss mailing list