What is DNS cache?
DNS cache allows IP addresses and other DNS records that your computer requests from a DNS server to be stored in temporary but very fast memory.
As a result, the next time your computer, tablet or smartphone asks the DNS server for DNS records, it can retrieve them from its fast DNS cache memory!
This ensures that a website , app, or video/image on the Internet can load a lot faster, because the part where you lose time requesting DNS records is no longer needed, because your device has already stored the DNS records locally.
Why empty DNS cache?
But, then, why is it necessary to empty the DNS cache? Isn’t it just an advantage and makes everything faster?
That’s right! Only sometimes you may have made a change in the DNS records of your domain name . For example, you may have linked your domain name to another hosting provider.
This domain name already points on the Internet to the new hosting provider, but when you surf from your device where you previously visited the domain name, it still points to the old provider. So the DNS records are not yet pointing to the correct hosting provider on your device.
This is because the old DNS records are still in your local DNS cache. Your PC has no need to retrieve the new DNS records and so the domain name continues to point locally to the old hosting provider.
If you clear your local DNS cache in this case, you make sure that your device fetches the new DNS records and you end up with the new hosting provider!
Emptying the DNS cache is also called in the IT world: DNS cache flush, DNS flushing or DNS cache flushing.
Empty DNS cache per operating system
- Empty DNS cache in Windows .
- Empty DNS cache in Mac OSX
- Empty DNS cache in Linux
- Empty DNS cache in Google Chrome
Emptying the DNS cache in Windows
With the steps below you can easily and quickly empty the DNS cache in your Windows computer. This ensures that your computer fetches the latest DNS records.
Empty Windows DNS cache roadmap
- You click on the “Start” button at the bottom of your task bar.
- Go to “Windows services” and select the “Command prompt”.
- Then you get a black window in which you can type. Enter the following line: “ipconfig /flushdns”.
- After entering this line, press “Enter”. Then you get the message: “Successfully flushed the DNS resolver cache”.
- Your local DNS cache on Windows is now cleared and your PC will retrieve the new DNS records!
Clear DNS cache in Mac OSX
With the steps below you can easily and quickly empty the DNS cache of your Mac OSX computer. This will ensure that your computer will automatically retrieve the latest DNS records.
Empty Mac OSX DNS cache roadmap
- You open the “Finder” app at the bottom of your taskbar.
- Then you will see a menu at the top of your screen. Here you click “go” and then “Utilities”.
- A window with all programs will open. Here find the program called “Terminal” and open it.
- Next, you will get a window in which you can type. Here you type the following line: “sudo killall -HUP mDNSResponder” and press “enter”.
- The window will ask for the password of your computer. You enter this and then press “enter” again.
- Unfortunately you will not get a success message, but as soon as you get no response back after pressing enter, you can interpret that as success and you have succeeded in clearing your DNS cache on Mac OSX.
- Do you get an error message? Then you can enter the following command: “sudo discoveryutil udnsflushcaches”. If you press “enter” here and you don’t get an error, then your DNS cache has been successfully emptied!
Emptying the DNS cache in Linux
With the steps below you can easily and quickly empty the DNS cache in your Linux computer. This ensures that your computer fetches the latest DNS records.
Empty Linux DNS Cache Roadmap
- In linux make sure you open your terminal. This is often in your apps/programs and/or can also be opened via “Activities” at the top of your desktop. If you do it through “Activities”, you will get a search bar, in which you can type “terminal” and press “enter”. After that, the terminal will open itself.
- You will see a window in which you can type. Here you enter the following line: “sudo systemd-resolve –flushcaches” and press “enter.”
- Once you press enter, the terminal will ask you for your password. Once you have entered it, press “enter” again. The DNS cache will then empty itself and your PC will automatically retrieve the latest DNS records!
- Do you get an error message and it does not work? Then enter the following command in the terminal: “sudo /etc/init.d/dns-clean start”. After you enter this, hit enter.
- The PC will ask for your passwords again, enter them and press enter. Your DNS cache will now be cleared!
Empty DNS cache in Google Chrome
With the steps below you can easily and quickly empty the DNS cache in Google Chrome. This will ensure that your browser fetches the latest DNS records.
Empty Google Chrome DNS cache roadmap
- First, open Google Chrome on your device.
- Then click on your address bar where you normally enter the domain name. Here you enter the following line exactly: “chrome://net-internals/#dns”.
- Once you’ve entered it, hit “enter.” A screen will open where you will see a button called: “Clear host cache”. Press this button and Google Chrome’s DNS cache will be cleared immediately and Chrome will automatically retrieve the latest DNS records!