Today we will learn How to Flush DNS in Windows, Linux, and Mac OS X. Error 404 Ill not found an error on your local machine. Other devices may open the same webpage. This means you need to flush the DNS’s cache to fix the 404 error. In this guide, we will show how you can flush or clear the DNS’s cache from your local machine.
Requirements to Flush DNS in Windows, Linux, and Mac OS X
- A machine for flushing the DNS cache.
- Root access for the Linux and Mac OS X machines.
Procedure
Flush DNS For Windows users
– Open Command Prompt using administrator privileges
– Run the following command
ipconfig /flushdns
If you see the following message, it means the DNS cache has been deleted successfully. Windows IP Configuration has successfully flushed the DNS resolver cache.
Flush DNS For Linux Users
– Open the terminal
– Install NSCD (Name Service Caching Daemon) on your Linux machine using the following commands
CentOS users
yum install -y nscd
Debian users
apt install nscd -y
For other distributions, you can refer to their documentation at the package manager.
– Run one of the following commands to flush the DNS’s cache
sudo service nscd restart
or
sudo /etc/init.d/nscd restart
macOS Users
– Open The Terminal
– Run one of the following commands according to your Mac OS X version
The Mac OS X version 10.10.4 and newer:
dscacheutil -flushcache; sudo killall -HUP mDNSResponder
The 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 version 10.6-10.8:
sudo dscacheutil -flushcache



