DNS is key to browsing the Internet
DNS (Domain Name System) is a key component of Internet browsing, translating friendly domain names into IP addresses that computers can understand. However, your system may store those addresses in its DNS cache for a time, which may become stale or incorrect. Performing a “DNS Flush” or “cleaning DNS” is a basic troubleshooting step that can help fix connectivity issues. Next, I will explain how to perform this action in the most common operating systems: Windows, Linux and Mac OS X.
Windows
- Press the Windows key and type
cmd
in the search. - Right-click on “Command Prompt” and select “Run as administrator.”
- In the Command Prompt window, type the following command and press Enter:
ipconfig /flushdns
- You should see a message confirming that the DNS cache has been successfully flushed.
Linux
On Linux, the process varies slightly depending on which DNS caching service your system is using. For systems that use nscd
:
- Open a terminal.
- Type the following command and press Enter:
sudo /etc/init.d/nscd restart
Or if your system is using systemd-resolved
:
- Open a terminal.
- Type the following command and press Enter:
sudo systemctl restart systemd-resolved
macOS
- Open the terminal (you can find it in Applications > Utilities).
- Depending on your version of macOS, the command may vary. For recent versions, type the following command and press Enter:
sudo killall -HUP mDNSReply
You will need to enter your administrator password to run it.
For older versions of Mac OS X, the command can be one of the following:
sudo dscacheutil -flushcache sudo killall -HUP mDNSResponder
- There is no confirmation prompt on Mac, but the command will restart the DNS service and flush the cache.
Performing a DNS Flush is a quick and easy method that often fixes network connectivity issues, and it's good to know how to do it on any operating system you may be using.