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.
- OS X is handling DNS differently compared to other OS. The DNS list is not working as you might think, you entered two DNS Servers, your local DNS server 10.20.1.3 and Google DNS 8.8.8.8 for public, but this is not how OS X will deal with your DNS list entries. Here is a short snipped from the OS X 'resolver' documentation.
- 1) Mac OS X uses lookupd to cache all sorts of query results, including DNS results. The second time you request a web page, your mac will not initiate DNS requests that it did the first time. This is observable with tcpdump.
- This article will show you how to manually configure Jump Desktop on a Mac OS X machine. Manual configuration steps are suitable for advanced users, for most users we recommend using the automatic configuration guide.
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.
Tip: There's a free tool in the CleanMyMac X app that automatically clears the DNS cache. Check it out — here's the link to download this program.
My server would be my newly reclaimed Mac Mini running the latest version of OS X (El Capitan 10.11.x). With a good recommendation from a good friend and Sysadmin from work I set out to build my own DNS server with 'dnsmasq' and found it to be surprisingly easy. Alternatives to Dns Jumper for Windows, Mac, Linux, Wine, Software as a Service (SaaS) and more. Filter by license to discover only free or Open Source alternatives. This list contains a total of 7 apps similar to Dns Jumper. List updated: 7/30/2019 8:38:00 AM.
This option is found in the Maintenance tab when you install CleanMyMac X. See the screenshot above. When you click Run, the cache will be cleared automatically and your internet settings should optimize.
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.
How to clear the DNS: The manual way
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
As we've explained above, you can auto-delete these outdated cache files with an app. To our knowledge, the only app that does it is CleanMyMac X by MacPaw. This is a well-known Mac maintenance app that also 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.
Another thing worth trying is clearing the browser cache itself (not the same as clearing the DNS list). You can do it automatically for all browsers, if you open CleanMyMac X.
This should potentially:
- Fix small access-related issues
- Free up space
Run CleanMyMac X.
Click the System Junk tab in the sidebar.
Look through the list of found items and click Clean.
Should be pretty easy — 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
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.
These might also interest you:
DNS is an integral service to most modern networks. The Domain Name System, or DNS is comprised of hierarchical and decentralized Domain Name Servers, or DNS Servers. This is how we connect to computers and the websites that reside on computers by their names, rather than having to memorize the IP addresses of every single computer out there. So you get to type https://krypted.com/ and come to my website instead of typing the IP address. Or more likely, Facebook.com, but just because my website is older, I’m not mad about that. No really…So you have a macOS Server and you need to take your DNS records out of it and move them to another solution. Luckily, DNS on any operating system is one of the easiest to manage. So let’s start by dumping all of our zone records and settings using the dnsconfig command:
/Applications/Server.app/Contents/ServerRoot/System/Library/PrivateFrameworks/DNSManager.framework/dnsconfig list
ACLs:
com.apple.ServerAdmin.DNS.public
Options:
directory: /Library/Server/named
allow-recursion: com.apple.ServerAdmin.DNS.public
allow-transfer: none
forwarders: 8.8.8.8 4.4.4.4
Views:
com.apple.ServerAdmin.DNS.public
Zones:
test.com
Options:
allow-transfer: none
allow-update: none
Resource Recs:
testalias.test.com (CNAME)
test.com (SOA)
test.com (NS)
test.com (MX)
test.test.com (A)
Resource Recs:
no resource recs
0.0.127.in-addr.arpa
Options:
allow-update: none
Resource Recs:
0.0.127.in-addr.arpa (SOA)
0.0.127.in-addr.arpa (NS)
1.0.0.127.in-addr.arpa (PTR)
0.0.10.in-addr.arpa
Options:
allow-transfer: none
allow-update: none
Resource Recs:
1.0.0.10.in-addr.arpa (PTR)
0.0.10.in-addr.arpa (SOA)
0.0.10.in-addr.arpa (NS)
cat /Library/Server/named/db.test.com
test.com.10800 IN SOAtest.com. admin.test.com. (
2018033001
3600
900
1209600
86400)
10800 IN NStest.test.com.
10800 IN MX0 test.test.com.
test.test.com.10800 IN A10.0.0.1
testalias.test.com.10800 IN CNAMEtest.test.com.
- Primary Zone: The DNS “Domain”. For example, https://krypted.com/ would likely have a primary zone of krypted.com.
- Machine Record: An A record for a computer, or a record that tells DNS to resolve whatever name is indicated in the “machine” record to an IP address, whether the IP address is reachable or not.
- Name Server: NS record, indicates the authoritative DNS server for each zone. If you only have one DNS server then this should be the server itself.
- Reverse Zone: Zone that maps each name that IP addresses within the zone answer with. Reverse Zones are comprised of Reverse Mappings and each octal change in an IP scheme that has records mapped represents a new Reverse Zone.
- Reverse Mapping: PTR record, or a record that indicates the name that should respond for a given IP address. These are automatically created for the first IP address listed in a Machine Record.
- Alias Record: A CNAME, or a name that points to another name.
- Service Record: Records that can hold special types of data that describe where to look for services for a given zone. For example, iCal can leverage service records so that users can just type the username and password during the setup process.
- Mail Exchanger Record (aka MX record): Mail Exchanger, points to the IP address of the mail server for a given domain (aka Primary or Secondary Zone).
- Secondary Zone: A read only copy of a zone that is copied from the server where it’s a Primary Zone when created and routinely through what is known as a Zone Transfer.
- allow-transfer Takes one or more address match list entry. Address match list entries consist of any of these forms: IP addresses, Subnets or Keywords.
- allow-recursion Takes one or more address match list entry.
- allow-update Takes one or more address match list entry.
- allow-query Takes one or more address match list entry.
- allow-query-cache Takes one or more address match list entry.
- forwarders Takes one or more IP addresses, e.g. 10.1.1.1
- directory Takes a directory path
- tkey-gssapi-credential Takes a kerberos service principal
- tkey-domain Takes a kerberos realm
- update-policy Takes one complete update-policy entry where you can grant or deny various matched objects and specify the dentity of the user/machine that is allowed/disallowed to update.. You can also identify match-type (Type of match to be used in evaulating the entry) and match-name (Name used to match) as well as rr-types (Resource record types that can be updated)
serveradmin settings dns
And the output would look something like this:
dns:acls:_array_index:0:name = “com.apple.ServerAdmin.DNS.public”
dns:acls:_array_index:0:addressMatchList:_array_index:0 = “localhost”
dns:acls:_array_index:0:addressMatchList:_array_index:1 = “localnets”
dns:forwarders:_array_index:0 = “8.8.8.8”
dns:forwarders:_array_index:1 = “4.4.4.4”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:aliases = _empty_array
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:expire = 1209600
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:serial = 2018033001
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:allow-update = no
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:adminEmail = “admin@0.0.10.in-addr.arpa”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:machines = _empty_array
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:nameservers:_array_index:0:name = “0.0.10.in-addr.arpa”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:nameservers:_array_index:0:value = “test.test.com.”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:refresh = 3600
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:mailExchangers = _empty_array
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:reverseMappings:_array_index:0:value = “test.test.com.”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:reverseMappings:_array_index:0:ipAddress = “10.0.0.1”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:retry = 900
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:timeToLive = 86400
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:serviceRecords = _empty_array
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:name = “0.0.10.in-addr.arpa”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:reverseZones:_array_id:0.0.10.in-addr.arpa:allowZoneTransfer = no
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:aliases:_array_index:0:name = “testalias.test.com.”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:aliases:_array_index:0:value = “test.test.com.”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:expire = 1209600
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:serial = 2018033001
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:allow-update = no
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:adminEmail = “admin@test.com”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:machines:_array_index:0:name = “test.test.com.”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:machines:_array_index:0:ipAddresses:_array_index:0:ipAddress = “10.0.0.1”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:nameservers:_array_index:0:name = “test.com”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:nameservers:_array_index:0:value = “test.test.com.”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:refresh = 3600
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:mailExchangers:_array_index:0:address = “test.test.com.”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:mailExchangers:_array_index:0:priority = 0
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:reverseMappings = _empty_array
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:retry = 900
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:timeToLive = 86400
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:serviceRecords = _empty_array
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:name = “test.com”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:primaryZones:_array_id:test.com:allowZoneTransfer = no
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:name = “com.apple.ServerAdmin.DNS.public”
dns:views:_array_id:com.apple.ServerAdmin.DNS.public:secondaryZones = _empty_array
Dns Jumper Mac Os X 10.8
Dns Jumper Mac Os X 10.13
sudo serveradmin settings dns > test.dns