How to Flush DNS Cache on Mac with Older macOS. The steps above work only for macOS Catalina and Big Sur. If you’re running an older macOS, you need to refer to the appropriate commands below. You will still be using the Terminal to enter the commands, just that the command lines are slightly different. To flush your local DNS cache in Mac OS (up to El Capitan) use your Terminal: Go to Applications Utilities Terminal Type the following command an In order to provide you with the best service, our website uses cookies.
When a system DNS works for a long time, it saves many records that cause DNS works slowly or not working correctly. To flush DNS cache, you need to clear DNS records from your system. You can do it with the command line in command prompt and Windows Powershell and Terminal on macOS systems.
The flush DNS command is the tool you need to clear and flush DNS cache. Just open the command line interface and dump the correct DNS cache then remove it.
The Domain Name System (DNS) is a hierarchical decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates more readily memorized domain names to the numerical IP addresses needed for locating and identifying computer services and devices with the underlying network protocols.
Clear and Flush DNS Cache with the command line:
- Open a command-line interface
- Display DNS Records
- Flush DNS Cache
- Check DNS Records
To flush DNS cache just follow the step by step guide. It works the same on all Windows operating systems, but different on various macOS and Linux distributions.
Related:Install and Configure DNS Server on Windows Server.
How to View DNS Cache
To view DNS cache on Windows systems, just type “ipconfig /displaydns” in command prompt.
- Press Windows+R to open the Run.
- Type “cmd” and press enter to open the command prompt.
- Now type “ipconfig /displaydns” to view DNS cache and records.
The ipconfig /displaydns result is like this.
There are too many DNS records on my system. But this is just an example of DNS cache in Windows system.
Flush DNS Cache in Windows 10
To clear Windows 10 DNS cache and records, type the “ipconfig /flushdns” command in command prompt or PowerShell.
That’s good, the DNS cache removed successfully. This command works the same on all Windows client and Windows server machines.
Check DNS Records
Now if you check again you can not find any DNS records.
Yes, the system can not display the DNS records. Because there is no DNS record cached yet.
Flush DNS Cache on macOS
Flushing the DNS in Mac OS X is an easy process, but the steps taken will depend on which version of OS X you are running. For the different version of macOS operating system use the following command to clear and flush DNS cache.
macOS Sierra, OS X El Capitan, Mac OS X Yosemite, Mac OS X Mavericks, Mac OS X Mountain Lion, Mac OS X Mountain Lion, and Mac OS X Lion.
If you are running Mac OS X 10.11, you need to follow the below steps:
- Open up the command terminal.
- Run the command
sudo killall -HUP mDNSResponder
Mac OS X Snow Leopard.
If you are running Mac OS X 10.6, you need to follow the below steps:
- Open up a command terminal.
- Run the command
sudo dscacheutil -flushcache
Mac OS X Leopard and below.
If you are running Mac OS X 10.5.1 or below, you need to follow the below steps:
- Open a command terminal.
- Run the command
sudo lookupd -flushcache
Flush DNS Cache on Linux
If you are running the nscd Name Service Cache Daemon and wish to flush your DNS cache, then you will need to do the following.
- Open up a command terminal (either as root or run step 2 with
sudo
). - Run the command
/etc/init.d/nscd restart
- Now, you just have to restart the NSCD. To do, type the following command
Finally, ask your question related to the DNS server from the comment section.
In this article, we cover the best ways to clear your DNS cache on a Mac, including the different ways you can do that depending on the macOS you are running.
Your DNS cache acts like a memory that your Mac refers to when trying to figure out how to load a website.
Flushing the DNS isn’t a difficult task but the process changes with every new operating system. We’ll walk you through the steps needed to manually reset your DNS on latest macOS versions. But if you like you can fast forward to the automatic solution — with a free tool in CleanMyMac X.
What is DNS cache
So what’s DNS cache? It’s a list of domain names attributed to your last-visited websites. It’s not the same as recent online history. Domain name information is coded in numbers, for example, 174.142.192.113.
For example, when a website migrates to a new domain, its DNS address changes. Naturally, it becomes unreachable as your still Mac relies on the outdated DNS record.
So, DNS cache is a log book that translates this numerical information into human readable website names. After you’ve cleaned the DNS cache you may notice that some websites load slower — that’s perfectly normal. Your Mac has forgot them and is trying to access them from scratch.
Clear Dns Cache Mac Mojave
How to clear the DNS: The manual way
Flush Dns On A Mac
Before we get started, note that resetting the DNS cache will interrupt active web browsing activity so it’s worth closing your browser before performing a flush.
How to flush the DNS cache on macOS Mojave/Catalina
Are you familiar with Terminal? If not, no problem. All you’ll need to do is launch the Terminal app and paste in a couple of commands.
- Open the LaunchPad in the Dock and type in Terminal in the search bar.
- Enter the following syntax at the command line:
- Press Return, enter your password, and press Return again.
- You should now see a message saying “macOS DNS cache reset.”
- Exit the Terminal.
sudo killall -HUP mDNSResponder; sleep 2;
How to clear the DNS: The easy way
For those who want to get this done quickly, a much simpler alternative to clear the DNS cache on all versions of macOS is CleanMyMac X. This is a staple Mac cleaning solution and this app is notarized by Apple.
Flushing the DNS cache just so happens to be in its arsenal of features to help you do this.
To flush the DNS cache with CleanMyMac all you’ll need to do is download it — you can do that here for free.
Then…
- Launch CleanMyMac.
- Click on Maintenance from the sidebar menu.
- Select Flush DNS Cache.
- Click Run.
That’s it. Your DNS is all clear and everything should be back to normal. Or you can try one or more of the following methods.
How to clear the DNS on older macOS versions
The algorithm is the same, only the copy/paste command in Terminal will be different for each OS.
To flush DNS cache on macOS Sierra, paste this: sudo killall -HUP mDNSResponder;say DNS cache has been flushed
To flush the DNS cache in Mac OS X El Capitan and Yosemite, paste this:sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder;say cache flushed
Frequently Asked Questions
When should you flush or reset the DNS cache?
Flushing the DNS makes sense when you can’t open certain websites. Especially if they were perfectly available just a moment ago. You can also try this fix when your network slows down randomly or other network-related issues occur.
What will happen if I flush my Mac’s DNS cache?
Flushing the cache simply updates the entry on your Mac that corresponds to the server address. Next time you try to access this server i.e a website, it will load a bit slower —which is similar to cleaning your browser cache.
What are the alternatives to flushing the DNS cache on Mac?
If the above methods seem too technical, you may try to do a hard refresh in your browser. Another way to refresh outdated DNS entries is to delete browser caches.
Conclusion
Clear Dns Cache Mac Catalina
Clearing the DNS cache on Mac isn’t something you’ll have to do often but it’s a good way to troubleshoot named server errors. Use the correct command for your operating system and you’ll be able to resolve issues within seconds. If, for whatever reason, the command doesn’t work or you don’t feel confident using the Terminal, CleanMyMac will do the job for you.