Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How to display DNS cache in Ubuntu 9.04 running Firefox?

share|improve this question

3 Answers 3

First, Ubuntu doesn't cache dns by default, but there is a dns caching deamon available (nscd). If you have that installed you can try running the command below to flush it:

sudo /etc/init.d/nscd restart

Second, if you don't have nscd installed, you can try restarting your router. Some routers will cache dns entries.

Third, there are steps you can take to disable dns in Firefox, but I'm not sure how to clear it other than switching to offline mode and then back to online. You can do that by choosing File -> Work Offline.

share|improve this answer
    
Sorry. I read this as "how do you delete dns cache". –  w4g3n3r Oct 9 '09 at 17:55

Firefox maintains its own DNS cache, to reduce load on DNS servers and to speed up response time.

There is a DNS Cache add-on you can use to manage it. I haven't tried it so I can't speak to how well it works. It sets and adjusts the two values shown below, although it may have other tricks. It is also possible to optimize or disable it by hand.


Optimizing and disabling the cache both use the about:config interface. Type "about:config" into your address bar and hit enter. If you haven't done this before, you'll be presented with a warning. Click "I'll be careful, I promise".

In the filter bar, type "network.dns".

We'll create two entries by right-clicking on the page and selecting New > Integer. Do this once for each of:

  • network.dnsCacheExpiration (unconfirmed default: 60sec) After this amount of time, Firefox will re-query the DNS the next time the site is loaded.
  • network.dnsCacheEntries (unconfirmed default: 20) Number of entries cached.

Now you have a choice. Optimize, or disable?

  • To disable, set both new entries to 0. That's it.

  • To optimize, set network.dnsCacheExpiration to a larger value (eg 1800 or 3600 for 30 minutes or 1 hour), and set network.dnsCacheEntries to a larger value (100, or 1000). All done.

Be sure to read the linked page above to understand potential side effects of optimizing the cache.

share|improve this answer

Apparently, there is no (simple) way to do this, no neat UI. It could be possible debugging Firefox.

share|improve this answer

Your Answer

 
discard

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