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.

I'm having problems related to DNS solving in my Ubuntu 9.10.
Prior complaining to my ISP I would like to refresh my local DNS cache, like in Windows we do ipconfig /flushdns.

How can I do that in Ubuntu?

share|improve this question
add comment

4 Answers

up vote 39 down vote accepted

Øhh, ubuntu doesn't cache DNS per default. So there is nothing to flush! (but maybe your SOHO router does). Installing nscd will make ubuntu cache DNS, afterwhich you can clear your cache - but this is besides the point, when you don't have it installed yet!

share|improve this answer
4  
+1 for Ø intead of 0 –  Gaurav Kumar Jul 1 '13 at 16:56
add comment

Try the following:

sudo /etc/init.d/dns-clean start

It works for me.

share|improve this answer
add comment

Ubuntu 12.04 onwards uses dnsmasq for a local cache. Sending it a SIGUP (sudo killall -HUP dnsmasq) will re-read the cache.

NOTES
When it receives a SIGHUP, dnsmasq clears its cache and then re-loads /etc/hosts and /etc/ethers and any file given by --dhcp-hostsfile, --dhcp-optsfile or --addn-hosts. The dhcp lease change script is called for all existing DHCP leases. If --no-poll is set SIGHUP also re-reads /etc/resolv.conf. SIGHUP does NOT re-read the configuration file.

share|improve this answer
    
this looks reasonable. although, I have to find another of the problems I used to have (that are related to new sites in the /etc/hosts and Opera) to test this and mark as accepted instead of the other :P –  Igoru Dec 4 '12 at 19:28
    
That's fine. I actually came across this looking to clear out my own cached dns entry. Once I found the solution though, I felt I should add my findings here. I don't know at what version Ubuntu started using dnsmasq though. –  ytjohn Dec 5 '12 at 15:01
    
This works and should really be marked as the answer! –  HDave Mar 13 '13 at 20:03
add comment

I just had this problem with a site for which I changed the DNS, and googling for a solution I found this page.

In my experience Firefox sometimes keeps its own DNS cache and doesn't clear it in time. So if you're viewing a site in Firefox, and keep seeing the old site, trying Chrome might solve the problem. If that works, you can clear the cache in Firefox. This happened in Ubuntu, I don't know if this happens on Windows or OSX as well.

I don't have nscd installed. I noticed however that in the terminal the new DNS is found several minutes later, so the problem solved itself.

share|improve this answer
add comment

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.