Empty Dns Cache Mac

Introduction to DNS Cache

The Domain Name System (DNS) is a critical component of the internet infrastructure that translates human-readable domain names into IP addresses that computers can understand. When you visit a website, your device sends a request to a DNS resolver to look up the IP address associated with the domain name. To improve performance and reduce the load on DNS servers, operating systems and browsers cache DNS records. However, this cache can sometimes become outdated or corrupted, leading to issues with accessing websites. In this article, we will explore how to empty the DNS cache on a Mac.
Why Clear DNS Cache?

There are several reasons why you might need to clear the DNS cache on your Mac:
- Resolving Website Access Issues: If you’re having trouble accessing a website, clearing the DNS cache can help resolve the issue by forcing your Mac to fetch the latest DNS records.
- Updating DNS Records: If you’ve recently updated your website’s DNS records, clearing the cache can ensure that your Mac starts using the new records.
- Troubleshooting Network Issues: Clearing the DNS cache can be a useful troubleshooting step when diagnosing network connectivity problems.
Clearing DNS Cache on Mac

The process for clearing the DNS cache on a Mac varies depending on the version of macOS you’re running. Here are the steps for different versions:
- macOS High Sierra and Later: You can use the
sudo killall -HUP mDNSResponder
command in the Terminal app to clear the DNS cache. - macOS Sierra and Earlier: Use the
sudo discoveryutil udns flushcaches
command to clear the DNS cache.
- Open the Terminal app on your Mac. You can find it in the Applications/Utilities folder or use Spotlight to search for it.
- Type the appropriate command for your version of macOS and press Enter.
- Enter your administrator password when prompted.
📝 Note: Be careful when using the Terminal app, as some commands can potentially harm your system if used incorrectly.
Alternative Method: Restarting Your Mac

If you’re not comfortable using the Terminal app, you can also try restarting your Mac to clear the DNS cache. This method is simpler but may not be as effective in all cases.
Checking DNS Cache Status

After clearing the DNS cache, you can verify that the cache has been successfully cleared by using the
scutil --show State:/Network/Service/<your_service_id>/DNS
command in the Terminal app. Replace <your_service_id>
with the actual ID of your network service.
Command | Description |
---|---|
`sudo killall -HUP mDNSResponder` | Clears the DNS cache on macOS High Sierra and later. |
`sudo discoveryutil udns flushcaches` | Clears the DNS cache on macOS Sierra and earlier. |
`scutil --show State:/Network/Service/ |
Displays the current DNS cache status. |

To summarize the key points:
- The DNS cache is an essential component of the internet infrastructure that improves performance by storing DNS records locally.
- Clearing the DNS cache can help resolve website access issues, update DNS records, and troubleshoot network problems.
- The process for clearing the DNS cache on a Mac varies depending on the version of macOS you’re running.
- Alternative methods, such as restarting your Mac, can also clear the DNS cache.
The information provided in this article should help you understand the importance of the DNS cache and how to clear it on your Mac. By following the steps outlined above, you should be able to resolve any issues related to the DNS cache and improve your overall internet browsing experience.
What is the DNS cache, and why is it important?

+
The DNS cache is a local storage of DNS records that improves internet performance by reducing the number of requests made to DNS servers. It’s essential for fast and reliable website access.
How do I clear the DNS cache on my Mac?

+
To clear the DNS cache on your Mac, use the sudo killall -HUP mDNSResponder
command in the Terminal app for macOS High Sierra and later, or sudo discoveryutil udns flushcaches
for macOS Sierra and earlier.
What are the benefits of clearing the DNS cache?

+
Clearing the DNS cache can help resolve website access issues, update DNS records, and troubleshoot network problems. It can also improve overall internet browsing performance by ensuring that your Mac uses the latest DNS records.