How to Flush DNS Cache on Windows, Mac, RedHat, and Ubuntu?

What your DNS cache does is to temporarily store the locations (IP addresses) of all your recently viewed websites on your local device so that next time you access those sites, they load faster. This is very convenient as your computer will not have to look for the corresponding IP address of a website each time you try to open the page. This cache automatically updates over a certain time. However, if the location of the website changes before the entry in your DNS cache updates, your computer will still be looking for it at its old address. To avoid that, all you have to do is flush the DNS cache of your computer. Here is how to do it:

Flush DNS on Windows 7,8, and 10

  • Go to your Windows search bar (Windows key + S) and type Command Prompt.
  • Select Run as Administrator.
  • Inside the black box run the following command:
ipconfig /flushdns
  • If it runs properly, it will return the following message:
Windows IP configuration successfully flushed the DNS Resolver Cache.
Flush DNS Cache

Flush DNS in MacOS

To run the command for flushing DNS, you must know the computer’s administrator account password.

cPanel Hosting from WebhostFace
  • Go to Applications -> Utilities -> Terminal.
  • Enter one of the following commands, depending on the version of your MacOS:
MacOS 10.10.4 and above: sudo killall -HUP mDNSResponder
MacOS 10.10.1, 10.10.2, and 10.10.3: sudo discoveryutil mdnsflushcache
MacOS 10.7, 10.8, and 10.9: sudo killall -HUP mDNSResponder
MacOS 10.5 and 10.6: sudo dscacheutil -flushcache
  • You will be asked to fill in the password for the administrative account of the computer
  • If you don’t see any messages, you have successfully flushed the DNS cache

Flush DNS in RedHat

  • Open the terminal
  • Reboot the Daemon using one of the following commands
# service nscd restart

or

# /etc/init.d/nscd restart 

Flush DNS in Ubuntu

  • Open the terminal
  • If nscd is not installed yet, type in the following command:
sudo apt-get install nscd
  • Flush DNS Cache in Ubuntu by restarting the nscd
sudo /etc/init.d/nscd restart

If you need any help flushing your DNS cache or you still cannot see your website after that, feel free to contact our technical support team!