What is DNS caching?
The DNS cache is the operating system memory of recent websites you've visited on your computer.
It's similar to a temporary storage container for data (DNS records, IP addresses, and host names) that your computer uses to access websites rapidly. This eliminates the need to restart the process of reloading information from the site's host server each time you visit a website. This DNS caching process allows the browser to load a website quickly the next time you visit it.
What is the point of flushing the DNS cache?
Please keep in mind that, while DNS caching may appear to be a great way to speed up website access and reduce traffic, it does have some disadvantages. A security flaw and incorrectly displayed website content are among them.
These issues can be avoided by clearing or flushing your DNS on a regular basis.
This article will give you the necessary steps to clear or flush your cached DNS.
Microsoft Windows 10 & 11
Close the application you are currently working with, such as an Internet browser or email client.
- Simultaneously press the
+ R
keys
- This will bring up the Run
dialog window.
- Type cmd
in the text box and select OK.
- When the black screen appears, type the following command and press Enter:
ipconfig /flushdns
- Restart your application (browser or email client).
Mac OS X
Close the application you are currently working with, such as an Internet browser or email client.
- Go to your Applications
folder.
- Open Utilities
and double-click on Terminal
.
- Type the following command and press Enter depending on the macOS version:
• OS X 10.12 (Sierra) and later
sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache
• OS X 10.11 (El Capitan) and OS X 10.12 (Sierra)
sudo killall -HUP mDNSResponder
• OS X 10.10 (Yosemite)
Versions 10.10.4+
sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder
Versions 10.10.1, 10.10.2, 10.10.3
sudo discoveryutil udnsflushcaches
• OS X 10.9 (Mavericks)
dscacheutil -flushcache; sudo killall -HUP mDNSResponder
• OS X 10.7 (Lion) and 10.8 (Mountain Lion)
sudo killall -HUP mDNSResponder
• OS X 10.5 (Leopard) and 10.6 (Snow Leopard)
dscacheutil -flushcache
• OS X 10.4 (Tiger)
lookupd -flushcache
- Enter the administrator username and password when prompted.
- Restart your application (browser or email client).
Linux
Note: Different distributions and versions of Linux may have slightly different commands due to configuration differences. One of the commands below will probably work.
- Type the following command as a root on terminal window and press Enter
:
sudo /etc/init.d/nscd restart
- Some distributions support this command:
sudo /etc/init.d/dns-clean start
- Or support this command:
sudo service nscd restart
Some installations may have NSDS located in a different directory, as in the following example. You may need to locate where it is installed to be able to run the correct command.
/etc/rc.d/init.d/nscd restart
Restart your application (browser or email client).