How to Flush DNS Cache on Windows, Mac

Clearing the DNS Cache

There can be problems with your internet browsing experience primarily due to DNS cache memory. Flushing your DNS cache is a proven way to solve slow browsing issues and improve your website surfing performance.

DNS cache memory stores your browsing history. It stores all the IP addresses that your device has searched or used.

What is the Purpose of Clearing the DNS Cache?

To summarize, here are the essential benefits of flushing the DNS flash memory:

  • Resolve DNS-related issues
  • Data security
  • Refresh DNS information
  • Fix website loading issues
  • Eliminating bad connections
  • Improve network performance

Let’s explain in brief these points.

Resolved DNS-related issues

Over time, the DNS cache memory accumulates past residue files from browsed websites. These DNS records may get corrupted, slowing down your network connectivity.

Data security

You must flush the DNS cache regularly if many people access your computer. This approach is necessary to ensure data security. Unless you clear the cache regularly, those accessing your device will find out about the website others are using by visiting the DNS cache memory.

Open the Command Prompt window and enter ipconfig /displaydns. This code will display the addresses of every site you have visited.

Code to Display Addresses of Site

Refresh DNS information

There can also be instances when this cache memory stores incorrect information or some IP address. If such information or an inappropriate IP address collides with other specific addresses, it may compromise your internet browser’s performance.

Fix website loading issues

You may need help opening a website. Often, old website residues hamper a site’s performance and prevent specific sites from loading. To fix website loading issues, flush the DNS memory cache. This method will erase all the past website residues left in the cache memory.

Type ipconfig /flushdns inside the Command Prompt to clear the website residues from the DNS cache.

Code to Clear The Website Residues

Eliminating bad connections

The DNS memory may have some wrong and inappropriate entries. Flushing the DNS cache memory will delete those inappropriate entries, thus eliminating the bad connections and enhancing the network’s security.

Improve network performance

When left unattended for a long time, DNS cache memory will be filled with IP addresses from the past websites browsed. As a result, your network performance will be compromised, slowing down in several instances. Flushing the DNS cache will delete these old IP addresses and give the memory a fresh start to begin from scratch. There will be a significant improvement in your overall network performance and internet connectivity issues.

Why the DNS cache exists

DNS caching exists to smoothen the internet browsing process. A well-managed DNS cache promises a streamlined search for IP addresses of specific domain names. If managed properly, it can result in:

  • Faster DNS resolution
  • Reduced network traffic
  • Better Load distribution
  • Offline access to websites

We shall discuss how to flush/clear your system’s DNS flush memory here. No matter which operating system you use, there are ways to manage the flushing process.

Method 1: How to Flush DNS Cache on Windows

How to Clear DNS Cache on Windows via Command Prompt

Here are the steps to flush DNS Cache using Windows command prompt.

Step 1) Click START from your Windows screen.

Step 2) Type CMD in the search space.

Step 3) Ensure you run the Windows command prompt with admin rights.

Step 4) To include admin rights, right-click the command prompt.

Step 5) A toggle window will open. From that window, select RUN AS ADMINISTRATOR.

Step 6) Once you have opened the Command Prompt, just type ipconfig /flushdns and hit the ENTER key*.

Step 7) You will notice the message “Successfully flushed the DNS Resolver Cache”.

*Please note: You need to include a space after the ipconfig and then proceed with the /flushdns to flush DNS Windows 10.

Code to Flush DNS Windows 10

How to Flush DNS Cache through Windows PowerShell

Step 1) Select the Start option, and then on the blank space, type PowerShell

Step 2) A list box will open, and you will notice Windows PowerShell listed at the top.

Step 3) You can either double-click it or look at the right side of the panel and click on open.

Step 4) Once PowerShell opens, you need to type Clear-DnsClientCache and hit ENTER.

Flush DNS Cache through Windows PowerShell

Step 5) After you press Enter, the DNS cache will be erased. However, there will be no delete-confirmation message displayed on the screen.

Step 6) If you want to see the delete-confirmation message, just type ipconfig /flushdns on the PowerShell window.

Flush DNS Cache through Windows PowerShell

Method 2: How to Clear DNS Cache on Mac

Clearing DNS Cache via Terminal

The process in brief:

Step 1) Mac: > Finder> Applications. [Enter]

Step 2) Applications>Utilities>Launchpad>Terminal. [Enter]

Step 3) Terminal> <command string as per the Mac version> [Enter]

Step 4) <input admin password>. [Enter]

Step 5) # The following message is displayed: # <the DNS cache has been reset.>

The process in detail:

When you want to flush DNS Mac, you need access to the Terminal first.

The Terminal is a Command Line Interface that comes preinstalled in Mac OS. Like the Command Prompt console in Windows, Terminal is a similar application in the Mac operating system. The process is simple.

You can open the Terminal app by launching the Spotlight Search. At the top of the screen, move towards the right side, and you will notice a magnifying glass-style icon.

Clear DNS Cache on Mac

Click inside the search bar to type “terminal.app” or “terminal” and press enter. You will notice the option to open the Terminal is displayed. Click on the option, and the Terminal will open:

Clear DNS Cache on Mac

Once the Terminal opens, enter a specific code in the window.

Before entering the code, learn which version of MacOS you are using.

How to Find the Version of Mac Running on your Apple Device?

The APPLE icon is located at the top left side of the screen. Click the icon to open the menu. From there, click on ABOUT THIS MAC.

The screen will display the Mac version name and version number. Refer to the below screenshot:

Version of Mac Running on your Apple device

Below is a list of Command Strings for the latest 5 versions of Mac OS:

Mac OS Version Number and Name Command String
macOS 12 (Monterey), sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 11 (Big Sur) sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 10.15 (Catalina) sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
macOS 10.14 (Mojave) sudo killall -HUP mDNSResponder
macOS 10.13 (High Sierra) sudo killall -HUP mDNSResponder

Once you have entered the command string according to the version of Mac you are using, the window will display a space to enter the password of your system. The password will stay hidden, even when you are typing. Enter the password carefully to avoid any typing mistakes.

After typing the password, hit the ENTER key. The Mac clear DNS cache process never displays any confirmation message after completion. Rather, a terminal prompt will be on display.

Clearing DNS cache through macOS Mojave and later

The process is similar to what we have discussed in the above section. Among the different versions of Mac OS released over the years, the 10.14 version is known as macOS Mojave.

When it’s time to flush your DNS cache, Mojave users need to follow these steps:

Step 1) Start> Applications> Utilities> Terminal.

This Prompt will launch the Terminal window. You can also press the Command and Space keys from the keyboard together.

Step 2) On the Terminal Window, just type sudo killall -HUP mDNSResponder

Step 3) After typing the command string, press the RETURN key.

Step 4) The screen will show you a prompt asking for the ADMIN PASSWORD.

Step 5) Type the ADMIN PASSWORD and press the RETURN key.

The DNS cache is cleared from your macOS Mojave system. However, no notification indicating that the flush is cleared will be displayed.

Method 3: How to Flush the DNS Cache on Chrome

Almost everyone is familiar with Chrome, the popular browser from Google. This browser stores its own DNS cache. Never confuse it with the DNS cache stored in your System OS.

Clearing the DNS Cache on Chrome from Windows OS

To clear your Google Chrome browser’s DNS cache, here are the following steps:

Step 1) Launch Google Chrome from your OS. You may have a Chrome icon present on the desktop. Or go to the start and type CHROME. Click OPEN from the right-hand toggle window.

Clearing DNS Cache on Chrome from Windows

Step 2) Once you have opened the Chrome browser, enter the following Command on the address bar of the browser: chrome://net-internals/#dns

Clearing DNS Cache on Chrome from Windows

Step 3) Click the CLEAR HOST CACHE tab.

Step 4) Once clicked, it will clear the DNS cache memory from the Chrome browser.

Clearing the DNS Cache on Chrome from macOS

The process is fairly simple. Here are the steps:

Step 1) You need to install Google Chrome on your macOS for flush chrome dns cache.

Step 2) Launch the browser from the DOCK or APPLICATION folder after installation.

Clearing the DNS Cache on Chrome from macOS

Clearing the DNS Cache on Chrome from mac

Clearing the DNS Cache on Chrome from macOS

Step 3) In the Chrome browser address bar, type: chrome://net-internals/#dns

Step 4) Click on the CLEAR HOST CACHE button.

Step 5) Although it will not display any notification, Chrome’s DNS Cache will be cleaned.

Method 4: How to Flush DNS Cache on Firefox

Firefox is a popular browser from Mozilla. Like other browsers, it stores browsing residues and site scripts on the cache memory. Clearing this DNS cache on Firefox is necessary to improve the overall browsing experience, like webpage loading speed, browser security, etc.

Clearing DNS Cache on Firefox from Windows OS

Here is a trick to clear everything from the Firefox browser – cache, cookies, browsing history, all at the click of a single button.

Step 1) Firefox browser> Menu> Menu Panel.

Step 2) Menu Panel> History> Clear Recent History.

Clearing DNS Cache on Firefox from Windows OS

Step 3) From the page, you can select the TIME RANGE of the history to be cleaned. Open the Dropdown Menu and pick the time range for which you want to flush the history.

Step 4) You can also choose what to delete and what not to. You can unselect the boxes to keep some of the available options.

Step 5) After the selections are done, click the OK tab. The items you have selected will be erased from the history, and the window will terminate.

Flush DNS Cache on Firefox using Clear Data

Here are the steps to clear only the DNS cache of Firefox:

Step 1) Firefox> Menu> Settings.

Step 2) Settings> Privacy & Security.

Step 3) Privacy & Security> Cookies and Site Data.

Step 4) Cookies and Site Data> Clear Data.

Flush DNS Cache on Firefox using Clear Data

Step 5) Since it’s only about removing the DNS cache, you need to check on the CACHED WEB CONTENT box.

Step 6) Click on the CLEAR tab. The DNS cache will be flushed from the browser.

Step 7) You can now close the page. The changes will automatically take place.

Clearing DNS Cache on Firefox from macOS

Firefox will run only on macOS version 10.12 and higher.

Step 1) You can open Firefox from the dock or Application folder.

Step 2) Open the Menu> Preferences> Privacy> Security.

Step 3) A toggle window will open Once you click on security.

Step 4) Check the box beside CACHED WEB CONTENT.

Step 5) Press CLEAR NOW.

The DNS cache is flushed out of your Firefox browser in macOS.

Method 5: How to Flush Clear DNS Cache on Safari

Safari, the default web browser of macOS, has a different way to clear the DNS cache on Safari. Determining where the DNS cache clear option is is challenging without knowing the settings.

Here are the steps to locate and clear the DNS cache in Safari:

Step 1) Safari> Menu Bar.

Step 2) Menu Bar> Safari > Settings.

Step 3) Click Settings to open a Window. Refer to the image below:

Flush Clear DNS Cache on Safari

Step 4) Check the box beside SHOW DEVELOP MENU IN MENU BAR.

Step 5) Now, you can exit the window.

Step 6) Menu Bar> Develop.

Step 7) After you click the Develop section, a dropdown window will open like this:

Flush Clear DNS Cache on Safari

Step 8) You need to scroll down to the option that reads Empty Caches and click on it.

Step 9) The DNS cache will be erased from your Safari browser.

Demerits Of Corrupt DNS Cache

The DNS Cache can lead to some serious troubleshoots if it gets corrupted.

  • Incorrect Redirects: DNS cache poisoning can cause incorrect redirects for a site. Your website may contact the wrong IP address, resulting in links opening some inappropriate web pages.
  • Deteriorates Browser Performance: It is necessary to delete the outdated information stored in the cache memory to improve the performance of the browser. The presence of outdated information and corrupt residue files may slow the browser’s overall performance and increase the load time of web pages.
  • Connectivity Issues: Browsing harmful or unprotected sites may result in bugs corrupting the DNS cache. Such bugs often prevent websites from opening or loading.
  • Difficulty in resolving domain names: DNS failure happens when the domain name fails to connect with the IP address. You will see a message that reads <DNS SERVER NOT AVAILABLE> or <ADDRESS CANNOT BE FOUND>

What are the Correct Ways to Clear the DNS and Browser Cache?

Launch the Command Prompt from Windows OS with Admin Rights, type ipconfig /flushdns, and press ENTER.

If you use a MacOS device, open the Terminal and type <command string as per the Mac version> as the flush DNS command. After entering the Command, press Enter. The screen will ask for the admin password. Input the password and press Enter.

FAQS

There is no hard and fast rule on how often you clean your DNS cache. Flushing the DNS cache once a couple of weeks ensures better browser performance.

The DNS cache takes around 15-20 minutes to get completely cleaned.

Conclusion

Cleaning the DNS cache memory is important as it improves the performance of your system. Leaving the DNS cache memory uncleaned for too long can lead to corrupting the residue files within the cache. Such files can be vulnerable and result in causing security issues and frequent browsing errors. That is why you must flush your DNS memory occasionally to prevent browsing lags and other related troubleshoots.

Clearing the cache files using the suitable DNS flush command in different Operating Systems and Browsers is simple enough. Just follow the abovementioned procedures to flush the DNS cache for a better performance.