DNS Cache issues on the Mac

Generally, you should clear the DNS cache when you experience DNS-related errors on your Mac. This includes any DNS error messages you see in your browsers as well as any apps you use on your Mac.
In macOS, you can flush the DNS cache by running a command with Terminal. There are variations of this command and you need to use the one that s appropriate for your macOS version.

Step 1. Find Your macOS Version
The first thing you need to do is to find your macOS version. This will help you decide which command to use to clear the DNS cache.
To check your macOS version, click the Apple logo in the top-left corner of your screen and select About This Mac.
You ll see your macOS name as well as its version. Take note of this version as you ll use it in the following section when you actually delete the DNS cache.

Step 2. Run a Command to Flush the DNS Cache
You ll use a Terminal window to execute a command and flush the DNS cache on your Mac. Here s how you do that:

1.Open Terminal by finding it with Spotlight, Launchpad, or Finder.
2. If your macOS version is 10.11 or later, type the following command into the Terminal and hit Enter:
sudo killall -HUP mDNSResponder
3. If you use macOS version 10.10, use this command to flush the DNS cache:
sudo discoveryutil udnsflushcaches
4. macOS 10.7, 10.8, and 10.9 users should use this command:
sudo killall -HUP mDNSResponder
5 macOS 10.6 owners have to run the following command:
sudo dscacheutil -flushcache
6. If you run macOS 10.5 or earlier, here s the command to let you flush the DNS cache:
sudo lookupd -flushcache

If you notice, each command has sudo at the beginning; this means you ll be asked to enter your admin password before you can run a command. Make sure you have your password handy before you try and execute any of these commands on your Mac.
When you flush the DNS cache, you re only deleting the cached entries of the DNS. You won't experience any issues as a result of removing these DNS cache files

  • 0 Users Found This Useful
Was this answer helpful?