This question already has an answer here:

We recently moved our website to a new server. But after changing the NS (name server) records, I can't access my website. The hosting provider said we need to flush the DNS settings in order to see the new website.

I searched relating to this but I couldn't find a way to flush DNS settings in Ubuntu 13.10.

marked as duplicate by Galgalesh, karel, Charles Green, Fabby, Zanna Sep 3 '18 at 20:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Usually NS takes time to update its records & it depends. As far as I know, Ubuntu doesn't cache DNS by default but your ISP (assuming). Refer How do I clear the DNS cache? – AzkerM Feb 7 '14 at 13:09

Install nscd using the following command if not yet

sudo apt-get install nscd

Flush DNS Cache in Ubuntu by restarting the nscd

sudo /etc/init.d/nscd restart
  • ^_^ Thank you again @maythux :) – Pramod Feb 7 '14 at 13:21
  • I'm so sorry. I'm new to Ubuntu and this forum too! Thank you telling me that :D – Pramod Feb 7 '14 at 13:30
  • @user245632 you are welcomed – Maythux Feb 7 '14 at 13:31
  • @Pramod an upvote is fair – Maythux Feb 10 '14 at 10:42
  • @Ask That application only enables DNS caches, as mentioned by AzkerM and me, Ubuntu does not cache DNS by default. – owl Jun 13 '14 at 11:49

There is no actual need to flush DNS as Ubuntu doesn't cache DNS. Instead, your ISP may be caching DNS. If you want to enable DNS cache, install pdnsd and resolvconf.

  • @Pramod if it has helped you, please upvote! Thank you :) – owl Jun 13 '14 at 11:48

Ubuntu 18.04

Ubuntu 17.04 and onwards use systemd for DNS.

sudo systemd-resolve --flush-caches

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