{"id":1561,"date":"2021-05-20T08:50:26","date_gmt":"2021-05-20T05:50:26","guid":{"rendered":"https:\/\/www.scalahosting.com\/kb\/?p=1561"},"modified":"2023-03-01T13:50:44","modified_gmt":"2023-03-01T11:50:44","slug":"how-to-clear-the-local-dns-cache-in-mac-os","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/kb\/how-to-clear-the-local-dns-cache-in-mac-os\/","title":{"rendered":"How to clear the local DNS cache in Mac OS?"},"content":{"rendered":"<p><b>Windows, Mac OS, and Linux use Domain Name Servers<\/b><i><span style=\"font-weight: 400;\"> (DNS) <\/span><\/i><span style=\"font-weight: 400;\">cache to save name resolution information. Think of the DNS as a phone book or directory that indexes websites and their IP addresses.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In DNS caching, your browser or Operating System captures IP addresses you\u2019ve visited recently and saves them in a database. So, instead of rerouting your queries to DNS servers, the system answers them. Since caching keeps the IP addresses you\u2019ve queried, your load time is significantly faster.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, you may start experiencing connectivity issues if the<\/span><b> local DNS cache becomes outdated or corrupted.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">A number of things can corrupt the local DNS cache, including viruses and network attacks. But, you can resolve such problems by clearing your DNS cache.<\/span><\/p>\n<h2><b>What Happens During Caching?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Imagine that a friend asked you to meet at a restaurant you\u2019ve never been to. If you only have access to the phone book, it might take you longer to get the right address. However, your next visit to the same restaurant will be faster if you save the address.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When you type a website on your browser for the first time, your computer has no reference to it. So, <\/span><b>it looks up the address on a DNS server, <\/b><span style=\"font-weight: 400;\">which in turn links it to the right IP address. Your local DNS then caches this information for easy navigation to sites you visited before without having to query the DNS server each time.<\/span><\/p>\n<h2><b>So, Why Clear Your DNS Cache?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">As mentioned earlier, different events can lead to your DNS cache becoming corrupted. Sometimes,<\/span><b> when website owners change location<\/b><span style=\"font-weight: 400;\">, they may have to change DNS servers as well. So, the site you plan to revisit may no longer be using the address you have in your <\/span><b>DNS cache.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">In some other cases, a malware might be trying to redirect popular sites to a malicious one. For instance, an attacker might insert a malicious<\/span> <a href=\"https:\/\/www.scalahosting.com\/blog\/what-is-my-ip\/\"><b>IP address<\/b><\/a><span style=\"font-weight: 400;\"> into your DNS record that redirects you to that address when <\/span><b>you try to visit Amazon.<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Whatever the case, you can clear your local DNS cache and start afresh.<\/span><\/p>\n<h2><b>The Implication of Clearing Local DNS Cache<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Clearing a DNS cache leads to the deletion of any saved DNS lookup information. Subsequently, your computer will have to update its data from DNS servers.<\/span><\/p>\n<p><b>The information saved in your DNS cache might include:<\/b><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Record name<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Record type<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Time to live (TTL)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Resource data<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Class<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Resource data length<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Let\u2019s see how to clear DNS cache in Mac OS.<\/span><\/p>\n<h2><b>How to clear the local DNS cache in Mac<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Clearing your DNS cache is fairly simple, depending on your OS and whether you\u2019re clearing it from your browser or computer. For Mac, you\u2019ll have to run the appropriate command in the terminal. However, it\u2019s not a <\/span><b>\u201cone size fits all\u201d<\/b><span style=\"font-weight: 400;\"> since Mac has different OS versions.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To check your version, go to the apple icon on the top bar of your computer and select<\/span><b> \u2018About This Mac\u2019<\/b><span style=\"font-weight: 400;\"> from the dropdown.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1562\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image3-4.jpg\" alt=\"How to clear the local DNS cache in Mac OS?, How to clear the local DNS cache in Mac\" width=\"644\" height=\"399\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image3-4.jpg 644w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image3-4-300x186.jpg 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">The first piece of information you\u2019ll see on the pop-up will be the current version of your OS.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1567\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image1-4.jpg\" alt=\"How to clear the local DNS cache in Mac OS?, How to clear the local DNS cache in Mac 2\" width=\"1214\" height=\"604\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image1-4.jpg 1214w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image1-4-300x149.jpg 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image1-4-1024x509.jpg 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image1-4-768x382.jpg 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">This knowledge helps you know which steps to follow. As mentioned before, regardless of the version of your mac OS, you\u2019ll run the appropriate code in the terminal. However, screenshots here are from<\/span><b> Big Sur <\/b><i><span style=\"font-weight: 400;\">(11.3).<\/span><\/i><\/p>\n<p><span style=\"font-weight: 400;\">If you don\u2019t know where to find the terminal, use the search function on the top right side of your desktop.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1568\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image2-4.jpg\" alt=\"How to clear the local DNS cache in Mac OS?, How to clear the local DNS cache in Mac 3\" width=\"567\" height=\"207\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image2-4.jpg 567w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image2-4-300x110.jpg 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Then enter \u2018Terminal\u2019 in the pop-up.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1565\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image6-4.jpg\" alt=\"How to clear the local DNS cache in Mac OS?, How to clear the local DNS cache in Mac 4\" width=\"1276\" height=\"655\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image6-4.jpg 1276w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image6-4-300x154.jpg 300w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image6-4-1024x526.jpg 1024w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image6-4-768x394.jpg 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">This will open your command line interface.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1564\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image5-4.jpg\" alt=\"How to clear the local DNS cache in Mac OS?, How to clear the local DNS cache in Mac 5\" width=\"659\" height=\"528\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image5-4.jpg 659w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image5-4-300x240.jpg 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">The steps are the same for all the versions until this point.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now, choose the code to use based on your version.<\/span><\/p>\n<ul>\n<li><b>macOS Leopard (10.5)<\/b><span style=\"font-weight: 400;\">: <\/span><span style=\"font-weight: 400;\">sudo lookupd -flushcache<\/span><\/li>\n<li aria-level=\"1\"><b>macOS Snow Leopard (10.6):<\/b> <span style=\"font-weight: 400;\">sudo dscacheutil -flushcache<\/span><\/li>\n<li><b>macOS Lion (10.7), Mountain Lion (10.8), and Mavericks (10.9)<\/b><b><br \/>\n<\/b><b>: <\/b><span style=\"font-weight: 400;\">sudo killall -HUP mDNSResponder<\/span><\/li>\n<li aria-level=\"1\"><b>macOS Yosemite (10.10): <\/b><span style=\"font-weight: 400;\">sudo discoveryutil udnsflushcaches<\/span><\/li>\n<li><b>macOS El <span data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Capitan&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:637,&quot;3&quot;:{&quot;1&quot;:0},&quot;5&quot;:{&quot;1&quot;:[{&quot;1&quot;:2,&quot;2&quot;:0,&quot;5&quot;:{&quot;1&quot;:2,&quot;2&quot;:0}},{&quot;1&quot;:0,&quot;2&quot;:0,&quot;3&quot;:3},{&quot;1&quot;:1,&quot;2&quot;:0,&quot;4&quot;:1}]},&quot;6&quot;:{&quot;1&quot;:[{&quot;1&quot;:2,&quot;2&quot;:0,&quot;5&quot;:{&quot;1&quot;:2,&quot;2&quot;:0}},{&quot;1&quot;:0,&quot;2&quot;:0,&quot;3&quot;:3},{&quot;1&quot;:1,&quot;2&quot;:0,&quot;4&quot;:1}]},&quot;7&quot;:{&quot;1&quot;:[{&quot;1&quot;:2,&quot;2&quot;:0,&quot;5&quot;:{&quot;1&quot;:2,&quot;2&quot;:0}},{&quot;1&quot;:0,&quot;2&quot;:0,&quot;3&quot;:3},{&quot;1&quot;:1,&quot;2&quot;:0,&quot;4&quot;:1}]},&quot;8&quot;:{&quot;1&quot;:[{&quot;1&quot;:2,&quot;2&quot;:0,&quot;5&quot;:{&quot;1&quot;:2,&quot;2&quot;:0}},{&quot;1&quot;:0,&quot;2&quot;:0,&quot;3&quot;:3},{&quot;1&quot;:1,&quot;2&quot;:0,&quot;4&quot;:1}]},&quot;9&quot;:0,&quot;12&quot;:0}\">Capitan <\/span>(10.11), Sierra (10.12), High Sierra (10.13), Mojave (10.14), and Catalina (10.15): <\/b><span style=\"font-weight: 400;\">sudo killall -HUP mDNSResponder<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>macOS Big Sur (11.2): <\/b><span style=\"font-weight: 400;\">sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">When you enter the appropriate code for your OS, you\u2019ll be prompted to enter your password.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1566\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image7-5.jpg\" alt=\"How to clear the local DNS cache in Mac OS?, How to clear the local DNS cache in Mac 6\" width=\"645\" height=\"530\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image7-5.jpg 645w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image7-5-300x247.jpg 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Once you do that, it\u2019ll clear your DNS cache on your computer.<\/span><\/p>\n<h2><b>How to clear the DNS cache on Your Browser (Google Chrome)<\/b><\/h2>\n<p><b>If clearing the DNS cache in your Mac OS doesn\u2019t resolve the issue<\/b><span style=\"font-weight: 400;\">, you might have to clear that of your browser.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you use Chrome, you can clear your browser\u2019s DNS cache by entering <\/span><b>\u2018chrome:\/\/net-internals\/#dns\u2019<\/b><span style=\"font-weight: 400;\"> into the address bar.<\/span><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1563\" src=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image4-4.jpg\" alt=\"How to clear the local DNS cache in Mac OS?, How to clear the DNS cache on Your Browser (Google Chrome)\" width=\"563\" height=\"356\" srcset=\"https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image4-4.jpg 563w, https:\/\/www.scalahosting.com\/kb\/wp-content\/uploads\/2021\/05\/image4-4-300x190.jpg 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Clicking \u2018Clear host cache\u2019 will clear you Chrome&#8217;s DNS cache.<\/span><\/p>\n<h2><b>Need Help?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Now you know how to clear the local DNS cache in your Mac OS you can go ahead and give it a try. If you need any help you can <\/span><a href=\"https:\/\/www.scalahosting.com\/contact-us.html\"><span style=\"font-weight: 400;\">contact our support at any time<\/span><\/a><span style=\"font-weight: 400;\">. We are available, around the clock.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Windows, Mac OS, and Linux use Domain Name Servers (DNS) cache to save name resolution information. Think of the DNS as a phone book or directory that indexes websites and their IP addresses. In DNS caching, your browser or Operating System captures IP addresses you\u2019ve visited recently and saves them in a database. So, instead [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"none","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_seopress_analysis_target_kw":"","footnotes":""},"categories":[22],"tags":[],"class_list":["post-1561","post","type-post","status-publish","format-standard","hentry","category-dns"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/comments?post=1561"}],"version-history":[{"count":5,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1561\/revisions"}],"predecessor-version":[{"id":5407,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/posts\/1561\/revisions\/5407"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/media?parent=1561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/categories?post=1561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/kb\/wp-json\/wp\/v2\/tags?post=1561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}