Guide to Flush DNS in Windows, Linux and Mac OS X
Hello,
Sick of Error 404 not found errors on your local machine? While other devices can open the same webpage. This means you have to Flush DNS Cache to fix 404 Errors. In this guide, we will show how you can flush or clean DNS Cache from your local machine.
Requirements
- A machine which needs to Flush DNS Cache
- Root Access for Linux and Mac OS X Machines
Procedure
Windows Users
- Open Command Prompt using Administrator Privileges
- Run the following Command
ipconfig /flushdns
- If you see the following message then it means DNS Cache is successfully removed.Windows IP ConfigurationSuccessfully flushed the DNS Resolver Cache.
Linux
- Open Terminal
- Install NSCD (Name Service Caching Daemon) to your Linux Machine using following commands
CentOS usersyum install -y nscd
Debian users
apt install nscd -y
For other distributions, you can refer their documentation to the package manager.
- Run the one of the following commands to Flush DNS Cache
sudo service nscd restart
or
sudo /etc/init.d/nscd restart
MacOS
- Open Terminal
- Run one of the following commands as per your Mac OS X Version
Mac OS X versions 10.10.4 and newer: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
So with this, we have covered guide to flush DNS for three common platforms.