How to flush dns

Content on WhatAnswers is provided "as is" for informational purposes. While we strive for accuracy, we make no guarantees. Content is AI-assisted and should not be used as professional advice.

Last updated: April 4, 2026

Quick Answer: Flushing your DNS cache clears out old or incorrect IP address information stored by your operating system. This can resolve website connection issues and ensure you're accessing the most current version of a site. The process involves opening a command prompt or terminal and entering a specific command.

Key Facts

What is DNS and Why Cache It?

The internet relies on the Domain Name System (DNS) to function smoothly. When you type a website address, like www.example.com, into your browser, your computer needs to know the specific numerical IP address (e.g., 192.0.2.1) that corresponds to that name. DNS servers handle this translation. To make this process faster and more efficient, your operating system and even your router often store a temporary record of recently visited domain names and their corresponding IP addresses. This is known as the DNS cache.

Imagine it like having a speed dial on your phone. Instead of looking up every contact's number in the main phone book every time, you have frequently called numbers readily available. Similarly, the DNS cache allows your computer to quickly retrieve the IP address for a website it has visited before, without needing to ask a DNS server each time. This significantly speeds up web browsing.

Why Would You Need to Flush Your DNS Cache?

While the DNS cache is beneficial for speed, it can sometimes become outdated or corrupted. This can lead to various connectivity issues:

Essentially, flushing the DNS cache forces your computer to go back to the DNS servers and get the most up-to-date IP address information for the websites you are trying to visit.

How to Flush Your DNS Cache

The process for flushing the DNS cache varies slightly depending on your operating system. Here are the common methods:

Windows

  1. Open Command Prompt as Administrator: Search for 'cmd' in the Windows search bar, right-click on 'Command Prompt', and select 'Run as administrator'.
  2. Enter the Command: In the command prompt window, type the following command and press Enter: ipconfig /flushdns
  3. Confirmation: You should see a message confirming that the DNS Resolver Cache was successfully flushed.

macOS

  1. Open Terminal: Go to Applications > Utilities > Terminal.
  2. Enter the Command: The command depends on your macOS version. For most recent versions (macOS Sierra and later), use: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. Press Enter.
  3. Enter Password: You will be prompted to enter your administrator password. Type it in (you won't see characters appear on screen) and press Enter.

Linux

Linux distributions handle DNS caching differently, often through services like systemd-resolved or nscd. The most common methods include:

Routers

Some home routers also maintain their own DNS cache. To flush your router's DNS cache, you typically need to restart the router. This usually involves unplugging the router's power for about 30 seconds and then plugging it back in.

When Should You Flush DNS?

You don't need to flush your DNS cache regularly. It's a troubleshooting step. Consider flushing your DNS cache if you encounter any of the following:

After flushing your DNS cache, it's a good idea to clear your browser's cache as well, just in case the browser itself is holding onto old data.

Sources

  1. Domain Name System - WikipediaCC-BY-SA-4.0
  2. How to Flush Your DNS Cache on Windows, Mac, and Linuxfair-use

Missing an answer?

Suggest a question and we'll generate an answer for it.