How to flush your DNS cache

Introduction

DNS (Domain Name System) caching is a crucial part of internet infrastructure, helping to reduce the load on DNS servers and speed up website access. However, sometimes you may need to clear your DNS cache to ensure you’re accessing the most up-to-date DNS information. This guide explains how to flush your DNS cache on both Windows and macOS systems.

Understanding DNS Cache

DNS caching, whether on your computer or network devices, can store DNS information for a specific period. This cached data can sometimes lead to delays in seeing DNS changes, especially when Time To Live (TTL) values are set for longer durations.

Quick and Thorough Method (Power Cycling)

One surefire way to flush your DNS cache is by restarting your router or modem and shutting down your device(s). This method is quick and thorough, as it clears the cache on your local devices and network equipment. Here’s how:

  • Power off your router or modem.
  • Shut down your computer or device.
  • Wait a few minutes (about 5 minutes) to ensure the cache is fully cleared.
  • Power on your router or modem.
  • Turn on your computer or device.

 

By doing this, you ensure a complete refresh of your DNS cache. However, keep in mind that your Internet Service Provider (ISP) may have DNS proxy servers that could still influence your cache. To bypass this, consider configuring your device to use third-party DNS servers like those provided by Cloudflare (1.1.1.1 and 1.0.0.1) or Google (8.8.8.8 and 8.8.4.4). These update far mor frequently and can help reduce latency associated with DNS resolution, meaning your internet feels faster.

Specific Instructions for Clearing DNS Cache

Here are the specific steps for clearing the DNS cache on Windows and macOS:

Clearing DNS Cache on Windows:

Ensure you are logged in as an administrator, or right-click on “Command Prompt” and select “Run as administrator.”

Access the Command Prompt:

  • Type “CMD” in the Windows Start menu search bar, then press Enter.
  • Or, navigate to the Windows System folder by clicking Start, scrolling to the folder, and opening it. Then, click “Command Prompt.”
  • Type the following command and press Enter:
ipconfig /flushdns

If the command runs successfully, you’ll see a message like: “Successfully flushed the DNS Resolver Cache.”

Clearing DNS Cache on macOS:

Open the Terminal application, which can be found in the Applications/Utilities folder or located using Spotlight.

Depending on your macOS version, use the appropriate command and press Enter:

For Mac OS X prior to 10.5.1 (Leopard):

sudo lookupd -flushcache

For Mac OS X 10.5 and 10.6 (Leopard and Snow Leopard):

sudo dscacheutil -flushcache

For Mac OS X 10.7, 10.8, and 10.9 (Lion, Mountain Lion, and Mavericks):

sudo killall -HUP mDNSResponder

For Mac OS X 10.10 and later (Yosemite, El Capitan, Sierra, High Sierra, Mojave, Catalina, Big Sur, Monterey):

sudo killall -HUP mDNSResponder

After executing the appropriate command, you will need to enter the administrator username and password to complete the operation. This clears the DNS cache on your macOS device.

By following these steps, you can effectively flush your DNS cache and ensure that you’re accessing the most current DNS information when browsing the web.