Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed dnscache (dnscache-run) from Ubuntu repositories and I have increased the CACHESIZE and DATALIMIT to 256MB (268435456).
Today I have tested it with one domain:
I have executed in console dig

;; Query time: 86 msec

I have repeated the query:

;; Query time: 0 msec

After I have visited various websites with Firefox for at least 10 minutes and I've repeated the query:

;; Query time: 87 msec

In 10 minutes of Internet surfing has it had to empty a cache of 256MB!? Furthermore, in those 10 minutes I've done several searches on
Based on these results so disappointing my question is obvious: Does dnsache really improve the surfing speed? Maybe something is wrong with my settings?

share|improve this question
Excuse the (very late) question but for anyone reviewing this, I see no reason to believe dnscache has an empty cache, only that it didn't cache Google's DNS records beyond their 5 minute time-out (as instructed). dnscache tries to be very secure and correct and is also fast but that is secondary. – mikebabcock May 1 '13 at 17:29

Short answer: No, not really.

Long answer: In my experience dnscache is very useful when it's installed to serve a number of different machines. Like for example on a router or a network gateway. It's not as useful for a lone machine, it's very likely that everybody in the middle (software, routers, etc...) is already doing dns cache, even firefox will do local DNS caching by default.

Now your results: dns record has TTL (Time-To-Live) of 298 seconds (now and for me). They are asking any dns cache not to keep they record for more time (they change IPs quite often), so dnscache should comply to this. If you try with some other domain with higher or 0 TTLs it shouldn't discard the cache so fast.

;; ANSWER SECTION:     298 IN  A

;; ANSWER SECTION:      16522   IN  A

This is digg output, 298 is the TTL for google, 16522 for yahoo. You can repeat your check with yahoo and expect the cache to live for near 5 hours.

share|improve this answer
And are the results of these queries normal? Where is the cache after 10 minutes? – Juan Simón Jun 10 '11 at 11:40
The results are normal, and the cache is dropped. The authoritative server for is asking caches to not keep it for more than 298 seconds. They should comply. – Javier Rivera Jun 10 '11 at 11:59
Ok, but my question isn't about the DNS cache of Google or another DNS, my question is about dnscache. With dnscache installed on my Linux and CACHESIZE/DATALIMIT = 256MB, the queries are flushed in 10 minutes! Is this normal with a dnscache of 256MB cache? – Juan Simón Jun 12 '11 at 9:48
I'm not talking about Google DNS cache either. Google DNS RECORDS, not cache, are asking ALL dns caches not to hold the data more than 298 seconds. If dnscache decides to ignore this information it can hold outdated information. I don't know why google is asking for this low retention time, but likely it is because they are changing (or want to be able to change) IPs each couple of minutes. – Javier Rivera Jun 13 '11 at 8:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.