{"id":1408,"date":"2023-10-12T19:43:56","date_gmt":"2023-10-12T14:13:56","guid":{"rendered":"https:\/\/www.veeble.org\/kb\/?p=1408"},"modified":"2025-03-26T11:26:38","modified_gmt":"2025-03-26T05:56:38","slug":"clear-dns-cache-mac-linux","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/clear-dns-cache-mac-linux\/","title":{"rendered":"How to Clear DNS Cache on Mac and Linux Systems"},"content":{"rendered":"\n<p>Follow these comprehensive methods to clear the DNS cache on Mac and Linux devices, ensuring smoother network operations.<\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"method-1-using-terminal\">Method 1: Using Terminal<\/h4>\n\n<h5 class=\"wp-block-heading\" id=\"for-mac-os-x\">For Mac OS X:<\/h5>\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Access the Terminal<\/strong>: To start, locate the &#8220;Terminal&#8221; in your &#8220;Utilities&#8221; folder within &#8220;Applications&#8221; or use Spotlight (Cmd + Space) to search for it.<\/li>\n\n\n\n<li><strong>Flush the DNS Cache<\/strong>: Open the Terminal and enter the following command, then press Enter:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder<\/pre>\n\n\n\n<p>You&#8217;ll be asked for your admin password; input it and press Enter. Note that you won&#8217;t get a confirmation message, but rest assured, your cache is cleared. You may then exit the Terminal.<\/p>\n\n\n\n<p><\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"for-linux\">For Linux:<\/h4>\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open a Terminal<\/strong>: Depending on your Linux distribution, access the Terminal through applications or by pressing Ctrl + Alt + T.<\/li>\n\n\n\n<li><strong>Flush the DNS Cache<\/strong>: In the Terminal, use one of the following commands based on your Linux distribution:<\/li>\n<\/ol>\n\n\n\n<p>For <a href=\"https:\/\/ubuntu.com\/\" target=\"_blank\" rel=\"noopener\">Ubuntu 18.04 and newer<\/a> (with systemd-resolved)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">sudo systemctl restart systemd-resolved<\/pre>\n\n\n\n<p>For <a href=\"https:\/\/releases.ubuntu.com\/\" target=\"_blank\" rel=\"noopener\">older Ubuntu versions<\/a> or those using nscd:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">sudo \/etc\/init.d\/nscd restart<\/pre>\n\n\n\n<p>For distributions with dnsmasq:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">sudo service dnsmasq restart<\/pre>\n\n\n\n<p>If your distribution doesn&#8217;t have a specific DNS cache service, restart the networking service:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-small-font-size\">sudo service networking restart<\/pre>\n\n\n\n<p>Once executed, you may see notifications indicating service restarts, which means the cache has been flushed.<\/p>\n\n\n\n<p><\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"method-2-simply-restart-your-device\">Method 2: Simply Restart Your Device<\/h4>\n\n\n<p>A straightforward way to ensure a cleared DNS cache for both Mac and Linux is to reboot your computer.<\/p>\n\n\n\n<p><\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"method-3-clean-your-browser-cache\">Method 3: Clean Your Browser Cache<\/h4>\n\n\n<p>Encounter DNS issues while online? <a href=\"https:\/\/www.refreshyourcache.com\/en\/home\/\" target=\"_blank\" rel=\"noopener\">Clearing your browser cache<\/a> can alleviate website-specific challenges.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-full is-style-default\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2023\/10\/clear-cache-1.gif\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"918\" height=\"602\" data-id=\"1467\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2023\/10\/clear-cache-1.gif\" alt=\"clearing browser cache on chrome\" class=\"wp-image-1467\"\/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"method-4-toggle-your-network-connection-mac-only\">Method 4: Toggle Your Network Connection (Mac only)<\/h4>\n\n\n<ol class=\"wp-block-list\">\n<li>Click the network symbol in the menu bar.<\/li>\n\n\n\n<li>Choose &#8220;Turn Wi-Fi Off&#8221; or &#8220;Disconnect.&#8221;<\/li>\n\n\n\n<li>Wait a moment and then switch Wi-Fi back on or reconnect. This might help in refreshing the DNS cache.<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n<h4 class=\"wp-block-heading\" id=\"method-5-opt-for-alternative-dns-servers\">Method 5: Opt for Alternative DNS Servers<\/h4>\n\n\n<p>Facing continuous DNS problems? Consider switching to other DNS servers, such as <a href=\"https:\/\/developers.google.com\/speed\/public-dns\" target=\"_blank\" rel=\"noopener\">Google DNS<\/a> or <a href=\"https:\/\/www.opendns.com\/\" target=\"_blank\" rel=\"noopener\">OpenDNS<\/a>. This step might address your issues even if it doesn&#8217;t clear the cache.<\/p>\n\n\n\n<div class=\"wp-block-uagb-blockquote uagb-block-43c23225 uagb-blockquote__skin-border uagb-blockquote__stack-img-none\"><blockquote class=\"uagb-blockquote\"><div class=\"uagb-blockquote__content\">&#8220;Final Note: According to industry best practices and expert consensus, clearing the DNS cache is usually diagnostic, not routine. For persistent network issues, consult a network specialist or your ISP for more guidance.&#8221;<\/div><footer><div class=\"uagb-blockquote__author-wrap uagb-blockquote__author-at-left\"><cite class=\"uagb-blockquote__author\">~ Veeble Hosting<\/cite><\/div><\/footer><\/blockquote><\/div>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-6a64cab0 wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Simplify WordPress: Managed by Veeble.<\/h3><p class=\"uagb-cta__desc\">No tech hassle. Fast, secure, 24\/7 support. Auto-updates, backups, staging. Focus on content.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/in\/managed-wordpress\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">Explore Plans<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Follow these comprehensive methods to clear the DNS cache on Mac and Linux devices, ensuring smoother network operations. Method 1: Using Terminal For Mac [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":8292,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[22],"tags":[24],"class_list":["post-1408","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-domain","tag-dns"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/10\/How-to-Clear-DNS-Cache-on-Mac-and-Linux-Systems.jpg",1366,768,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/10\/How-to-Clear-DNS-Cache-on-Mac-and-Linux-Systems-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/10\/How-to-Clear-DNS-Cache-on-Mac-and-Linux-Systems-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/10\/How-to-Clear-DNS-Cache-on-Mac-and-Linux-Systems-768x432.jpg",768,432,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/10\/How-to-Clear-DNS-Cache-on-Mac-and-Linux-Systems-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/10\/How-to-Clear-DNS-Cache-on-Mac-and-Linux-Systems.jpg",1366,768,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/10\/How-to-Clear-DNS-Cache-on-Mac-and-Linux-Systems.jpg",1366,768,false]},"uagb_author_info":{"display_name":"Adrian Antony","author_link":"https:\/\/www.veeble.com\/kb\/author\/adrian\/"},"uagb_comment_info":0,"uagb_excerpt":"Follow these comprehensive methods to clear the DNS cache on Mac and Linux devices, ensuring smoother network operations. Method 1: Using Terminal For Mac [&hellip;]","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/1408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=1408"}],"version-history":[{"count":12,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/1408\/revisions"}],"predecessor-version":[{"id":8329,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/1408\/revisions\/8329"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/8292"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=1408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=1408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=1408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}