You may occasionally need to remove the DNS cache on your Mac after changing the host’s file or troubleshooting a problem. Even though it requires using the command line, clearing DNS on Mac is often considered an expert’s task. However, after reading this article, all Mac users should find the process rather simple.
- How to clear DNS cache in macOS Ventura and Monterey
- What is a DNS cache?
- Why should you clear DNS cache on Mac?
How to clear DNS cache in macOS Ventura and Monterey
- Launch Spotlight (command + spacebar) → type and choose Terminal.
- Paste the command below in the terminal.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- Press the return key.
- Enter your password.
- Hit return.
The password will not be seen in the terminal for security reasons.
Even though nothing will appear on the command prompt screen, your DNS cache will be flushed as soon as you press the return key.
What is a DNS cache?
Let’s first check what DNS is before moving forward to the DNS cache. To put it simply, DNS (Domain Name System) converts human-readable domain names like www.igeeksblog.com to computer-readable IP addresses like 220.127.116.11.
A DNS cache is temporary storage on a computer, smartphone, server, etc., that holds DNS records of previously visited domain names, such as a record for IPv4 addresses, AAAA records for IPv6, etc. It is often referred to as the DNS resolver cache.
Depending on the time-to-live (TTL), DNS keeps records of a website and its addresses which are stored in this fictitious database of information. In essence, the DNS cache is how your device tries to save time and effort by responding to a DNS query with a DNS record already present in the temporary DNS cache, rather than having to perform a lengthy DNS lookup.
Why should you clear DNS cache on Mac?
- The bigger the collection of cached addresses, the more you are revealing about yourself to the online world. Hence, it needs to be cleared.
- Hackers may be able to access your entries and drive you to bogus websites if they have access to the DNS cache.
- Technical issues can be resolved by doing a DNS flush. For example, when the erroneous version of the searched website is shown as a result of out-of-date entries. The connection to the web project is established after a flush, and the appropriate DNS server responds to the request again.
Clear DNS just for the Google Chrome browser. Open Chrome → enter chrome://net-internals/#dns in Chrome’s address bar → click Clear host cache.
You can clear the safari cache easily by following the steps in our article about clearing the Safari cache, history, and cookies on Mac.
Is it safe to clear DNS cache?
Yes, flushing the DNS cache on your Mac is secure. Although cached data is only temporary storage, clearing the DNS cache too frequently may affect the website load time. Did you succeed in clearing the DNS on your Mac, or did you run into trouble? Comment below, and I’ll try to respond as soon as possible.
- Wi-Fi not working on Mac?
- How to Change DNS on Your iPhone and iPad
- How to fix ‘Network is blocking encrypted DNS traffic’ on iOS
Readers like you help support iGeeksBlog. When you make a purchase using links on our site, we may earn an affiliate commission. Read Disclaimer.