Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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: google.es.
I have executed in console dig google.es:

;; Query time: 86 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)

I have repeated the query:

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)

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

;; Query time: 87 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)

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 google.es.
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

1 Answer 1

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: Google.com 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:
google.com.     298 IN  A   209.85.147.104

;; ANSWER SECTION:
yahoo.com.      16522   IN  A   72.30.2.43

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? –  Simón Jun 10 '11 at 11:40
    
The results are normal, and the cache is dropped. The authoritative server for google.com 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? –  Simón Jun 12 '11 at 9:48
1  
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

 
discard

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.