GuidesHow To'sHow To Clear DNS Cache?

How To Clear DNS Cache? [Detailed Guide]

Learn how to Clear DNS cache on Windows, macOS, Linux, Android, and iOS.

Domain Name System (DNS) translates the domain names into IP addresses a machine can understand. A DNS cache is a temporary storage area that stores information related to recent DNS searches. So, the next time you search for the same website, your computer will look for the information within the DNS cache rather than making a new request to the DNS server. If you’re facing network connectivity issues, try clearing the DNS cache.   

Key Takeaways
  • A DNS cache stores the results of the DNS searches related to websites and servers that you search for.
  • Clearing the DNS cache is effective in fixing network connectivity errors and slow loading times on your computer or mobile phone.
  • The method of clearing the DNS cache is different for each platform, but you can do it using the Command Prompt on Windows. 

Tip: Start by power cycling your internet router, as that can also help fix connectivity issues.

Windows 

Proceed with this method to erase the DNS cache on a Windows PC:

  1. Open Command Prompt: Type cmd in the Search Bar > Launch the Command Prompt.
    Command Prompt
    Search For Command Prompt (Image By Tech4Gamers)
  2. Run Command: Write and execute the command:
    ipconfig/flushdns
    DNS Code
    Execute DNS Code (Image By Tech4Gamers)
  3. Let It Complete: Wait until the message, Successfully Flushed The DNS Resolver Cache, appears in the window.

MacOS

By following these instructions, you can carry on the process on your Mac:

  1. Launch Terminal: Click the Spotlight icon on the top bar > Search for Terminal > Open it.
    How To Clear DNS Cache
    Search For Terminal (Image By Tech4Gamers)
  2. Execute DNS Command: The command to clear the DNS cache in macOS varies with the version. Type the right command based on your macOS > Enter.
    OS VersionDNS Flush Command Code
    Tigerlookupd – flushcache
    Ventura/Monterey/Catalina/Big Sursudo dscacheutil - flushcache; sudo killall -HUP mDNSResponder
    Yosemitesudo discoveryutil mdnsflushcache
    Lion/Mojave/Mountain Lion/Mavericks/Sierra/El Capitansudo killall -HUP mDNSResponder
  3. Confirm Password: Type your Password > Press Enter.

    How To Clear DNS Cache?
    Enter macOS Code (Image By Tech4Gamers)

Linux

I used the technique below for a quick DNS cache clear on my Linux computer:

  1. Access Linux Menu: Click on the Menu symbol on the left sidebar.
    How To Clear DNS Cache
    Click On Menu Button (Image By Tech4Gamers)
  2. Select Terminal: Navigate to and open Terminal from the app list.
    Terminal
    Choose Terminal (Image By Tech4Gamers)
  3. Calculate DNS Size: First, calculate the size of the DNS cache with:
    resolvectl statistics
  4. Flush DNS: Next, execute the command to remove the DNS cache:
    resolvectl flush-caches
  5. Verify New DNS Size: Ensure the process was successful by checking the cache size using the same code in Step 3.
    Run Linux Code
    Run Linux Code (Image By Tech4Gamers)

Android

Although these steps were performed on a Samsung interface, the steps for other phone models will be similar:

  1. Get To Apps: Tap the Settings icon on the Main Screen > Apps.

    Apps
    Scroll To Apps (Image By Tech4Gamers)
  2. Select Browser: Find Chrome or any other web browser you use on your phone.
    Chrome
    Navigate To And Pick Chrome (Image By Tech4Gamers)
  3. Access Storage: Go to the browser’s Storage.

    How To Clear DNS Cache
    Press Storage (Image By Tech4Gamers)
  4. Erase Cache: Press the Clear Cache button on the bottom panel.
    How To Clear DNS Cache
    Clear Cache (Image By Tech4Gamers)
  5. Pick Manage Storage: Next, tap Manage Storage to view more options.

    Manage Storage
    Choose Manage Storage (Image By Tech4Gamers)
  6. Delete Data: Hit the button, Clear All Data.

    Clear All Data
    Clear All Data (Image By Tech4Gamers)

iOS

For an iPhone, here is how you can get rid of the DNS cache:

  1. View General Settings: Head to the Settings > General.

    How To Clear DNS Cache
    Go To General (Image By Tech4Gamers)
  2. Select Storage: Under General Settings, go to iPhone Storage.
    How To Clear DNS Cache
    Select iPhone Storage (Image By Tech4Gamers)
  3. Choose The Browser: Tap on Safari or any other browser.
    How To Clear DNS Cache
    Tap Safari (Image By Tech4Gamers)
  4. Tap Website Data: Click on Website Data to view saved websites and links.

    Website Data
    Click On Website Data (Image By Tech4Gamers)
  5. Erase Web Data: Hit Remove All Website Data.

    Remove All Website Data
    Remove All Website Data (Image By Tech4Gamers)

When Should You Clear DNS Cache?

Sometimes, the data stored in the DNS cache can become corrupt or outdated, leading to problems when accessing a website. It can also cause errors on your computer or increase the loading time. Thus, it becomes necessary to clear the DNS cache to resume the proper operation of your device, for example, when;

  • You cannot access or load certain websites on your device.
  • It takes too long for the website to load properly.
  • You face network connectivity errors on your device.
  • You have updated the DNS settings or the Domain Name for your network.
Tip: Clear the DNS cache once a month for flawless network performance.

Pros And Cons Of Clearing DNS Cache

ProsCons
✅ Accelerates browsing speed❌ Removes locally configured data
✅ Ensures new settings are smoothly applied❌ Risk of DNS spoofing
✅ Resolves network connecivity errors❌ Slower initial loading

Final Words

Clearing the DNS cache proved to be an effective solution when websites were taking unusually long to load on my PC. After the procedure, I noticed a significant decrease in the loading time; however, only the initial load took a bit longer since the content had to be fetched again. The subsequent visits to the same sites were smooth and free of errors.

WARNING: Erasing DNS cache may reset your internet configurations on the system.

Frequently Asked Questions

What Does Clearing DNS Cache Do?

Clearing the DNS cache removes old and corrupt data in the DNS to allow quick and easy access to websites and network servers.

How Do I Clear DNS Cache On Linux?

Launch “Terminal” and execute the code “resolvectl flush-caches” to erase the DNS cache.

Can I Clear DNS Cache On My Mobile Phone?

Clear the browser’s data from your phone settings to wipe the DNS cache on your mobile.


More About Clearing Cache:

Related articles

How to Ground Yourself When Building A PC [Quick Steps]

How to Ground Yourself When Building a PC? In this in-depth guide, we'll be answering that question and others surrounding it.

PC Case: How to Clean Tempered Glass?

In this article, we'll be answering the questions: How to clean tempered glass PC? Why we use tempered glass? And more.

How To Install A Liquid CPU Cooler? [Step By Step]

Wondering about how to install a liquid cooler? Read our guide to learn about the quickest way to install it.

How Many Hard Drives Can A PC Have? [EXPLAINED]

In this guide, we'll be answering the question of how many hard drives can a PC have, and sharing information regarding storage devices.

How To Disable Firewall? [All Methods Guide]

This article provides a step-by-step guide on "How to disable the firewall" using different and easy methods.

Similar Guides