Clearing local DNS cache
This tutorial will show you how to clear your local DNS cache on:
After you clear your local DNS cache, you should also reboot the network equipment (routers, modems, etc.) within your premises.
Clearing the local DNS cache on Windows
- Press ⊞ Win+R on your keyboard to open the Run application.
-
Input the following command in the Run application window:
cmd
- Press ↵ Enter to open Windows Command Prompt. If your Windows account does not have admin rights, press Ctrl+⇧ Shift+↵ Enter.
-
Execute the following command in Windows Command Prompt:
ipconfig /flushdns
-
Press ↵ Enter, and you should receive the following output:
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.
Clearing the local DNS cache on macOS
- Go to "Finder" > "Applications" > "Utilities" > "Terminal" to open Terminal.
-
Input the following command in Terminal:
dscacheutil -flushcache;sudo killall -HUP mDNSResponder
- Press ↵ Enter to execute the command.
- Enter your Administrator password as this operation requires administrator privileges.
Clearing the local DNS cache on Linux
Not all Linux distributions use the same DNS service by default, and Linux allows you to install alternative DNS services, so please refer to the official documentation of your Linux distribution and/or alternative DNS service for instructions on clearing your DNS cache.
You can find instructions on how to clear the DNS cache on a default Ubuntu installation and few alternative DNS services (binddns, dnsmasq, and nscd) listed below:
Ubuntu (default installation)
To clear your local DNS cache on Ubuntu, you need to:
- Press Ctrl+Alt+T to open a Terminal window.
- Execute the following commands:
sudo /etc/init.d/dns-clean restart
sudo /etc/init.d/networking force-reload
binddns
To clear the binddns cache:
- Open a Terminal window. The default keyboard shortcut is Ctrl+Alt+T.
-
Execute the following commands:
sudo /etc/init.d/named restart
sudo rndc restart
sudo rndc exec
dnsmasq
Follow the steps listed below to clear your dnsmasq cache:
- Open a Terminal window. The default keyboard shortcut is Ctrl+Alt+T.
-
Execute the following command:
sudo /etc/init.d/dnsmasq restart
nscd
You can clear the cache of nscd by performing the following actions:
- Open a Terminal window. The default keyboard shortcut is Ctrl+Alt+T.
-
Execute the following command:
sudo /etc/init.d/nscd restart