How to flush your DNS Cache on Windows/Mac/Linux

One of the most common errors you will run into when failing to load your domain is related to your DNS cache.
Your connection will cache (store) the old version of the domain and if you then make changes, you may be stuck seeing the old version.
One of the main culprits for this is changing name servers. You may find your domain stuck for 24-72 hours while these name servers change.
Your connection has to be reset in order to see the new changes, and to do this, we use DNS flushing.
In order to do this, please follow the steps below for your correct operating system.

 

For Windows;

First, we need to get into the command prompt. To do this, either hit Start and type cmd or hit Windows key + R and type it in the dialog box.

Hit OK or your Enter key, and the command prompt will pop up in a new window.

From here, we simply need to input the following command; ipconfig /flushdns
Hit enter and you should see the following dialog in the prompt

You have now successfully flushed your DNS cache. You might need to restart your computer in order for the changes to take full effect.

 

For Mac/OS X;

First, you want to open a new Terminal.

Once you are in the Terminal, type the following command depending on your OS X version;

– Mac OS X versions 10.10.4 and newer:
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder
– Mac OS X versions 10.10-10.10.3:
sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches
– Mac OS X versions 10.9:
sudo killall -HUP mDNSResponder
– Mac OS X versions 10.6-10.8:
sudo dscacheutil -flushcache


You have now successfully flushed your DNS cache. You might need to restart your computer in order for the changes to take full effect.

For Linux;

First, you will need to open a new Terminal

Once you are in the Terminal, you will want to be logged in as the root user (For this example, we already are).
To do so, type the following command;
user@host:~$ su
Password: <type your root password>
And the following dialog will now be present;
root@host:

From here, we will now enter the command to flush the DNS cache.

root@host: /etc/init.d/nscd restart

You have now successfully flushed your DNS cache. You might need to restart your computer in order for the changes to take full effect.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *