Flush DNS: How to clear DNS cache records (2024)

Contents

  • What is the DNS cache?
  • How does a DNS cache work?
  • DNS flush command: What does “flush DNS” do?
  • How to clear DNS cache entries
    • How to clear DNS cache entries on macOS
    • How to clear DNS cache entries on Windows
    • How to clear DNS cache entries on Linux
    • How to clear DNS cache entries on Google Chrome
  • Why would you want to flush DNS?
  • FAQ

What is the DNS cache?

A Domain Name System (DNS) cache is a record of all the queries made to DNS servers by your device. To understand the role it plays in internet communications, we need to dive a little deeper into what DNS is and what it does.

To connect to a server over a network, your device needs to know its Internet Protocol (IP) address. You could simply enter the IP address by hand, but there’s a small problem — IP addresses are composed of long strings of numbers. And most brains just aren’t equipped to handle long sequences of numbers.

That’s where the Domain Name System comes in. The DNS is a special database that matches domain names to IP addresses. When you type a new web address into your browser, your device first queries its assigned DNS server, only initiating the connection to your desired website once it has the address in hand. And to prevent repeat requests, successful past DNS queries are stored in the DNS cache.

How does a DNS cache work?

A DNS cache works just like any other cache — it reserves space on your device to store DNS records that may be required again in the future. Before querying a DNS server, your device will check its DNS cache and, should it find a matching record, connect to the IP address it had stored in its memory. DNS caching greatly speeds up communications because you don’t have to go through DNS resolution every time you want to visit the same website.

Because the structure of the internet is fluid, with new servers springing up and old ones getting decommissioned every day, DNS records are rarely permanent. The life expectancy of a DNS entry is measured in seconds and is known as its “Time to Live” (TTL). The entry’s TTL value is set by the DNS server and measured in seconds — once the time is up, the record will be automatically purged from the device’s DNS cache.

DNS flush command: What does “flush DNS” do?

The “flush DNS” command lets you clear DNS from your cache — that is, manually expunge all held DNS records from memory regardless of their remaining TTL. By flushing your DNS cache, you’re basically telling your device that it needs to go through DNS resolution again and obtain new IP addresses for the websites that you used to visit.

Only Windows devices actually accept “flush DNS” as command — other operating systems require you to type something different or choose some other option. However, the term “flush DNS” has become stuck in our popular culture as a shorthand for any action to clear the DNS cache.

How to clear DNS cache entries

All major operating systems and browsers support DNS cache clearing. The instructions below will teach you how to flush DNS cache entries on macOS, Windows, and Linux devices, as well as the popular Google Chrome browser.

How to clear DNS cache entries on macOS

  1. Press the smiling blue face icon to open “Finder” and click on “Applications.”
  2. Open the “Utilities” folder and launch “Terminal.”
  3. Based on your OS, type in the appropriate command to flush DNS records:
    • Tiger (10.4): lookupd -flushcache
    • Leopard (10.5): sudo lookupd -flushcache
    • Snow Leopard (10.6): sudo dscacheutil -flushcache
    • Lion (10.7), Mountain Lion (10.8), Mavericks (10.9): sudo killall -HUP mDNSResponder
    • Yosemite (10.10): sudo discoveryutil mdnsflushcache
    • El Capitan (10.11), Sierra (10.12), High Sierra (10.13), Mojave (10.14), Catalina (10.15): sudo killall -HUP mDNSResponder
    • Big Sur (11), Monterey (12), Ventura (13): sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  4. Enter your password and press “Enter.” If you are successful, you will see a message stating that you’ve reset your DNS cache.

How to clear DNS cache entries on Windows

To flush DNS records on a Windows device, you will need to use the command prompt. The process is nearly identical for Windows XP, Windows Vista, Windows 7, and later Windows OS. Simply follow these steps:

  1. Click the “Start” button in the bottom-left corner of your screen.
  2. Open the command prompt:
    • Windows 10, Windows 11: Select “Command prompt” directly from the list.
    • Windows XP, Windows Vista, Windows 7, Windows 8: Click “All programs,” select “Accessories,” and choose “Command prompt.”
  3. In the command prompt window, type the following command: ipconfig /flushdns.
  4. Press “Enter” to confirm. If you are successful, you will see a message stating that the DNS resolver cache has been flushed.

How to clear DNS cache entries on Linux

The Linux operating system doesn’t come with DNS caching capabilities by default — this feature is implemented differently by each distribution. Here is what you need to do to clear DNS records on the most popular versions:

  1. Open the terminal by pressing Ctrl, Alt, and T simultaneously.
  2. Based on your distribution, enter the following command to flush DNS:
    1. Ubuntu: sudo systemd-resolve –flush-caches
    2. NCSD: sudo /etc/init.d/nscd restart
    3. Dnsmasq: sudo /etc/init.d/dnsmasq restart
    4. BIND: sudo /etc/init.d/named restart
  3. If prompted, enter your password to confirm that you want to flush DNS cache records.

How to clear DNS cache entries on Google Chrome

Browsers have their own DNS caches, separate from your operating system. If you flush DNS on your device but not your browser, you could still end up using outdated DNS records while browsing. Here’s what you need for a clean start on Google Chrome:

  1. Open Google Chrome on your device.
  2. Enter the following in the address bar: chrome://net-internals/#dns
  3. Click “Clear host cache” to flush DNS records.

Why would you want to flush DNS?

While DNS caching can greatly improve your online experience, there are also practical benefits to periodically flushing DNS. Here are a few good reasons why you’d want to flush your DNS cache at least once in a while.

  • Avoiding DNS spoofing. DNS spoofing refers to a wide range of cyberattacks that rely on altering the entries held on DNS servers to redirect victims to fake websites. The malicious DNS entries are distributed to the victims’ devices as part of the DNS resolution process and stored in their DNS cache. If your DNS server operators catch wind of what is going on, they will restore the proper values from backups — in that case, flushing your DNS cache will delete the bad entry from your system and let your device fetch a new one.
  • Solving DNS errors. Some users might try to flush DNS to fix the “DNS server not responding” error.
  • Avoiding DNS cache poisoning. DNS cache poisoning is a specific type of DNS spoofing that exploits the DNS lookup process. When a DNS server doesn’t have the requested DNS record on hand, it may query more authoritative servers for additional information. At this point, the hackers can bombard the DNS server with bogus responses to trick it into accepting the fake value as legitimate. Storing this value “poisons” the DNS resolver cache — the bad entry will now be returned to victim devices as part of DNS resolution. Just like with DNS spoofing, flushing your DNS cache will clear any compromised records and allow your device to request new values.
  • Clearing out old DNS entries. Some DNS records simply outstay their welcome. If a website’s IP address changes before the associated DNS record’s TTL expires, you could end up running into a wall of “server IP address could not be found” errors while trying to connect. To get the website’s new IP address, flush your DNS cache and enter the desired web address into your browser — your device will query the DNS server again, potentially netting you the new value.
  • Switching to a new DNS server. Most people use the default DNS server assigned to them by their internet service provider (ISP), but that’s not often their best option. ISP-assigned DNS servers may hold outdated information, block certain websites, or even compromise your privacy (because your ISP can see which DNS queries come from which IP address). As a result, many people switch to private DNS providers — but if they forget to flush DNS cache records after they change DNS servers, they’ll be stuck using their old DNS provider’s entries until the latter’s TTL expires.
  • Clearing private information. Just like your browsing history, your DNS cache stores information about where you’ve been online — after all, you wouldn’t have a DNS record if you didn’t try to visit the associated website. This private information can be dangerous in the wrong hands, such as criminals wishing to study your habits for a spear phishing attack. Periodically flushing your DNS cache prevents this sensitive data from accumulating.

FAQ

Flush DNS: How to clear DNS cache records (2024)

FAQs

Flush DNS: How to clear DNS cache records? ›

ipconfig /flushdns will flush the local computer cache. And dnscmd /clearcache will clear the dns server cache. With the former you will clear the "local" cache of the server you work on. It will NOT clear the dns server cache.

How do I clear DNS cache and flush DNS cache? ›

However, the message at the end varies and may require admin intervention.
  1. Click the Start button. ...
  2. Click All Programs > Accessories.
  3. Select Command Prompt.
  4. In the command prompt window, type ipconfig /flushdns.
  5. Press Enter.
  6. You should see a message confirming that the DNS Resolver Cache was successfully flushed.
Apr 3, 2024

What is the difference between DNS flush and clear cache? ›

ipconfig /flushdns will flush the local computer cache. And dnscmd /clearcache will clear the dns server cache. With the former you will clear the "local" cache of the server you work on. It will NOT clear the dns server cache.

Is flushing DNS cache safe? ›

Flushing the DNS cache is considered a safe and effective measure for resolving internet connectivity issues. This procedure is akin to routine maintenance for your network settings, devoid of adverse effects on system performance or security.

How do I clear DNS cache internals? ›

Flushing the DNS cache in Chrome

Open Chrome. In the URL bar, type in chrome://net-internals/#dns: In the left pane, select DNS. In the right pane, tap the Clear host cache button.

How do I clear my DNS history? ›

Click the Windows Start menu and type cmd to open Command Prompt. Select Run as administrator. Type the command ipconfig/flushdns and hit Enter to delete the DNS cache, which contains all the saved incognito history on your device.

How often should you flush DNS cache? ›

The process of flushing your DNS cache takes approximately 15 minutes and has no negative impact, so you may clear yours as frequently as you like.

How do I know if my DNS cache is cleared? ›

Open the Command Prompt by pressing the Windows key + R, typing cmd in the Run dialog box, and pressing Enter. Type the following command and press Enter: ipconfig /flushdns. You should see a message that says "Successfully flushed the DNS Resolver Cache."

Does flushing DNS delete history? ›

It will not clear anything other than your DNS cache, hence everything else will be where it was (passwords, auto-fill, etc). The purpose of DNS is to resolve hostnames (such as google.com) and convert it to its IP address (172.217. 12.46 in my case). Your cache will simply repopulate itself once you revisit a website.

How do I reset my DNS? ›

To reset your DNS in Windows:
  1. Using the Start Menu at the lower left corner of your screen: ...
  2. Enter CMD into the text box and then select the Command Prompt program.
  3. A new black window will appear. ...
  4. Type ipconfig /flushdns and press ENTER (please note: there is a space between ipconfig and /flushdns)
  5. Restart your computer.

Can clearing DNS cache cause problems? ›

Flushing DNS cache can be a useful troubleshooting technique, but it also has some drawbacks. Browsing speed can be reduced as your device will need to contact the DNS server more frequently to resolve website IP addresses.

What happens after flushing DNS? ›

Flush DNS command removes this stored cache and forces your device to retrieve the information from the DNS again. The Winsock reset restarts the communication required between your device and the network.

How do I reset my IP and flush DNS? ›

To release/renew your IP address, and flush DNS on Windows:
  1. Search box "Commend prompt"
  2. Type "ipconfig /release" and press Enter.
  3. Type "ipconfig /renew" and press Enter.
  4. Type "ipconfig /flushdns" and press Enter.
  5. Restart the computer.
Feb 7, 2022

How do I completely flush my DNS? ›

To Flush the DNS Cache:
  1. 1.At the bottom left corner, type 'cmd' in the Start menu's search bar, and press Enter.
  2. Type 'ipconfig /flushdns' in the Command Prompt, and press Enter.
  3. The user has now flushed the DNS Cache and will receive a message that they have successfully done so.
Aug 3, 2023

Can I see DNS history? ›

SecurityTrails (free)

SecurityTrails (previously DNS Trails) is an awesome free solution to lookup DNS history. This site contains access to a database of roughly 3.4 trillion DNS records, 3 billion WHOIS records, and 418 million hostnames. All of which have been collected daily since mid-2008.

How do I clean up DNS? ›

in dns manager, select the server and right click properties - select forwarder tab. there should either be a list of valid external DNS servers (remove any non valid old or internal ones) or it should have none and be set to root hints. Now re-test.

How to reset DNS settings? ›

To reset your DNS in Windows:
  1. Using the Start Menu at the lower left corner of your screen: ...
  2. Enter CMD into the text box and then select the Command Prompt program.
  3. A new black window will appear. ...
  4. Type ipconfig /flushdns and press ENTER (please note: there is a space between ipconfig and /flushdns)
  5. Restart your computer.

Does flushing DNS speed up internet? ›

If your device has cached incorrect DNS records, accessing the Internet becomes slow because your device will take time to find the correct records. These are the entries that the DNS cache stores, and by flushing them, you will get rid of them so that there will be faster and more accurate DNS resolution.

How do I clear the DNS cache on my router? ›

Turn off both your router & ONT. While they are off, clear your internet cache from all browsers, and close all browsers. Go to command prompt (cmd) run ipconfig /flushdns. Then run ipconfig /release.

Top Articles
Top 10 Altcoins of 2024
Samsung DeX | Apps & Services | Samsung US
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Lakeisha Bayer VM

Last Updated:

Views: 5862

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Lakeisha Bayer VM

Birthday: 1997-10-17

Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

Phone: +3571527672278

Job: Manufacturing Agent

Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.