Your Search Bar For Shrewd Tips

How Do I Clear Dns Cache On Mac?


If a website will not load, a domain points to an old server, or you have recently changed DNS settings, clearing the DNS cache on your Mac can help. The process is usually quick: open Terminal, run a command, and enter your administrator password. Your Mac may not show a confirmation message, but the cache-clearing command can still have worked.

This guide explains how to clear the DNS cache on modern macOS, what the command does, when to try it, and what to check if a website still will not connect. It also explains the difference between your Mac’s DNS cache and browser or router caches, so you can choose the right next step.

What Is the DNS Cache on a Mac?

DNS, or the Domain Name System, translates a website name such as example.com into the numerical IP address that computers use to find its server. Your Mac temporarily stores some of these lookups in a DNS cache. Keeping recent results can make repeat visits faster and reduce unnecessary requests.

A cached result can occasionally become outdated. This may happen after a website moves to a new server, a DNS provider changes its records, or you update network settings. If your Mac continues using an old lookup, a site might fail to load, open the wrong destination, or behave differently from the same site on another device.

Flushing the DNS cache removes stored DNS information so your Mac can request fresh results the next time it needs them. It does not delete files, saved passwords, browsing history, or personal documents. It may briefly make the first visit to some sites take slightly longer while fresh DNS lookups are made.

How to Clear the DNS Cache on a Mac

On most modern versions of macOS, you can clear the DNS cache using Terminal. The following steps apply to recent releases and many earlier versions of macOS:

  • Open Terminal. You can find it in Applications > Utilities, or search for Terminal with Spotlight by pressing Command-Space.
  • Copy and paste this command into the Terminal window: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • Press Return or Enter.
  • If Terminal asks for a password, enter the password for your Mac user account and press Return.
  • Close Terminal and try loading the website again.

The sudo part runs the command with administrator privileges. When you type your password, Terminal will not display letters, dots, or asterisks. That is normal: type the password carefully and press Return. If your account does not have administrator privileges, you may need an administrator to run the command.

The command contains two actions. dscacheutil -flushcache clears cached directory and name-service information, while killall -HUP mDNSResponder signals macOS’s DNS responder to reload. On current macOS versions, the process is managed by the operating system and normally continues running after the signal.

How to Know If the DNS Cache Was Cleared

Terminal usually gives no success message after these commands. A blank response does not necessarily mean the command failed. To check the result, open the site that was giving you trouble and see whether it now loads correctly. You can also test the site in another browser or try a different website.

If Terminal displays an error, check that you copied the command exactly, including the spaces and hyphen in -HUP. Make sure you entered your Mac account password correctly. You can run the command again; flushing the cache more than once is generally harmless.

Which Command Works for Your macOS Version?

The command above is suitable for most modern Macs. Apple has changed some networking components over the years, so instructions for very old releases of Mac OS X may use different commands. If you are using an older or unsupported version, first check which macOS release is installed by opening the Apple menu and choosing About This Mac. Then look for instructions that specifically match that release.

Be cautious with commands copied from old forums or websites. A command that was appropriate for an older system may be unnecessary on a current Mac. For most users on a recent macOS version, the command in this guide is the straightforward option.

When Should You Flush the DNS Cache?

Clearing the DNS cache can be useful when you have a specific connection problem that may be related to an outdated domain lookup. It is worth trying if:

  • A website has recently changed its hosting provider or server and your Mac still appears to reach the old location.
  • A domain works on your phone or another computer but not on your Mac, while both devices are using the same network.
  • You have changed DNS servers, such as switching to a DNS service provided by your workplace or internet provider.
  • You are troubleshooting a domain you manage and need your Mac to request updated DNS information.
  • A site produces a DNS-related error, such as a message saying that the server’s address could not be found.

Flushing the cache is not a general fix for every internet problem. It will not improve a slow Wi-Fi signal, repair a broken cable, restore an internet service outage, or resolve every browser error. If many websites fail on every device, the issue may be with your router, network, or internet provider instead.

DNS Cache, Browser Cache, and Router Cache: What’s the Difference?

Your Mac’s DNS cache is separate from the temporary data stored by a web browser. A browser cache may contain images, scripts, and other page files. Clearing the system DNS cache does not erase that browser data, and clearing browser history does not necessarily flush the Mac’s DNS cache.

Some browsers and privacy tools can also use their own DNS settings, including DNS over HTTPS. If the system command does not seem to change what happens in a particular browser, quit and reopen the browser, check its secure DNS settings, or test the site in another browser. Browser-specific network caches may require separate steps, which vary by browser and version.

Your router may keep DNS information too. Restarting the router can refresh its connections and may clear some temporary network state, but it is not the same as running the DNS flush command on your Mac. If the same domain fails for every device on your home network, restarting the router or contacting your internet provider may be more relevant than clearing the cache on one computer.

What to Try If the Website Still Will Not Load

If flushing DNS does not solve the problem, use these checks to narrow down the cause:

  • Check the address. Make sure the domain is spelled correctly and try the site’s main address, with or without www if appropriate.
  • Test another browser. If the site works elsewhere, the problem may involve the original browser’s settings, extensions, or cached data.
  • Try another network. A mobile hotspot can help determine whether your home or workplace network is involved.
  • Temporarily check VPN or security software. A VPN, firewall, filtering app, or managed work profile can affect DNS requests. Follow the relevant provider’s guidance before changing security settings.
  • Restart your Mac. A restart can resolve some temporary networking issues, although it is not usually required just to flush DNS.
  • Check the service status. The website itself may be down or experiencing a DNS configuration problem.

If the problem affects every device on the same network, restart your router if it is safe and appropriate to do so. If only your Mac is affected, review its network configuration and any VPN or DNS profile installed on it. On a work or school Mac, contact the administrator before changing managed settings.

Does Clearing DNS Cache Improve Privacy or Speed?

Flushing DNS is mainly a troubleshooting step, not a reliable way to make your Mac faster or substantially improve privacy. It removes stored DNS results from the local cache, but your network provider, DNS service, browser, or websites may still handle or retain information according to their own policies. It also does not conceal your IP address or replace a VPN.

In ordinary use, macOS manages DNS caching automatically, so you do not need to clear it on a schedule. Repeatedly flushing the cache without a specific reason is unlikely to provide a lasting benefit. Use the command when investigating a suspected stale DNS result, after a relevant network change, or when directed by a trusted support specialist.

Conclusion

To clear the DNS cache on most modern Macs, open Terminal and run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. Enter your administrator password if prompted, then test the website again. Terminal may show no confirmation, and that is normal.

Remember that a DNS flush only refreshes DNS information stored on your Mac. It does not clear browser files or necessarily refresh your router’s cache. If the problem continues, test another browser or network and check for VPN, router, or website issues. For most users, the command is a quick, safe troubleshooting step—not something macOS needs you to run regularly.


Disclaimer: Articles are written by Humans, AI or Both. Verify Important information.

Shrewdnia

Shrewdnia

Shrewdnia is a destination for curious minds seeking clarity, knowledge, and informed perspectives. Through insightful articles and practical guides our passionate team explores a wide range of topics designed to help readers understand the world around them, make smarter decisions, and stay informed in an ever-changing landscape.


💡 Every question sparks discovery, and every perspective enriches the conversation. Share your thoughts and insights in the comments 👇

Back to blog

Leave a comment

JOIN THE SHREWDNIA COMMUNITY FORUM

What do you think?

Have an opinion, experience, or question about this topic? Join the Shrewdnia Forum and share your thoughts with other readers.

Join the Forum →