What Is DNS Flushing
What is DNS flushing comes down to forcing your device to forget what it thinks it knows. DNS flushing clears the local DNS cache, the stored list of domain-to-IP mappings your device keeps to avoid repeating the same lookup, and forces a fresh query the next time you visit that domain. It sounds like a small maintenance task, but most explanations skip the layer that makes it actually work, and the layers it never touches at all. For how those domain-to-IP mappings get created in the first place, see DNS records explained: A, CNAME, MX, and more.
Why Your Device Caches DNS in the First Place
Caching exists for speed. Without it, every single request to a website would require a full DNS lookup, the process, the process of translating a domain name into an IP address, every single time, even for sites you visit repeatedly in the same hour. The DNS cache stores the answer locally for a set period, so repeat visits skip the lookup step entirely and load faster.
The TTL Explained: Why Flushing Actually Works
Every DNS record carries a TTL, or time to live, a value, typically somewhere between a few minutes and a full day, that tells your device how long to trust the cached answer before checking again. This is the mechanism most guides mention but never fully explain. A record with a 24-hour TTL is normally cached for a full day regardless of whether the underlying IP address changes in the meantime. DNS flushing bypasses TTL entirely. It doesn’t wait for the cached entry to expire naturally, it deletes it immediately and forces a fresh lookup on the next request. That override is the entire reason flushing exists as a troubleshooting tool.
Why You Might Need to Flush DNS
A handful of situations actually call for flushing:
- A website recently moved to a new server, and your device is still resolving to the old IP address
- You suspect DNS spoofing or cache poisoning, attacks where forged records get inserted into a cache, and want to remove any corrupted entries
- You’re getting connection errors or 404 errors that persist even though the site works fine on other devices
- You want to clear locally stored DNS history for local privacy reasons
Flushing is a troubleshooting step, not routine maintenance. There’s no benefit to doing it on a regular schedule if nothing is actually wrong.
How to Flush DNS Cache on Windows, Mac, and Linux
Windows
Open Command Prompt and run ipconfig /flushdns. This clears the operating system’s DNS cache immediately and confirms with a success message.
macOS
Open Terminal and run sudo killall -HUP mDNSResponder, which restarts mDNSResponder, the background service macOS uses to handle DNS resolution, clearing its cached records in the process.
Linux
On systems using systemd-resolved, the DNS resolution service common on many modern Linux distributions, run sudo systemd-resolve --flush-caches. The exact command can vary slightly depending on which DNS service your distribution uses.
Browser DNS Cache vs OS DNS Cache: Two Separate Systems
This is the distinction most consumer guides skip entirely. Standard DNS flushing commands only clear your operating system’s cache. Chrome, Firefox, and Edge each maintain their own separate internal DNS cache, independent of the OS. If you flush your OS cache and still see the old site or connection issue in your browser specifically, the browser’s own cache is likely still holding the outdated record. Chrome, for example, has an internal page for viewing and clearing its own DNS cache separately from anything the operating system controls. If you’re troubleshooting a browser-specific issue, flushing the OS cache alone often isn’t enough.
What Flushing DNS Doesn’t Fix
It Doesn’t Touch Router or ISP Caches
Flushing clears your device’s cache, but your home router often maintains its own DNS cache, and your ISP’s recursive resolver, the server that performs lookups on behalf of everyone on that ISP, caches records further upstream still. Multiple users troubleshooting stale IP issues discover that flushing their own device does nothing, because the outdated record is actually sitting in a router or ISP cache they have no direct control over. A router reboot sometimes clears its cache, but the ISP-level cache is entirely outside your control and simply persists until its own TTL expires.
It Doesn’t Improve Internet Speed
Flushing DNS does not change your actual connection speed. It only ensures you’re resolving to the correct, current IP address. Any speed improvement people report after flushing typically comes from fixing a misdirected connection, not from the cache clearing itself having any effect on bandwidth or latency.
It Doesn’t Log You Out of Anything
DNS cache stores domain-to-IP mappings, not session or login data, so flushing has no effect on whether you stay logged into a website.
It Doesn’t Delete Your Browser History
DNS cache and browsing history are entirely separate systems. Flushing DNS removes technical lookup records, not the list of pages you visited, which your browser stores independently.
A Security Trade-Off Worth Knowing
There’s one consideration almost never mentioned outside security circles. Clearing the DNS cache also removes forensic artifacts, evidence of past DNS activity that can be useful for investigating a security incident. Security teams investigating a suspected compromise generally want to capture that cache data before flushing it, since flushing destroys potential evidence of what domains a compromised device was actually contacting. For everyday troubleshooting this trade-off rarely matters, but it’s worth knowing that flushing isn’t a purely neutral action from a forensic standpoint. This connects to broader questions about how DNS-level attacks work in the first place, covered in what is a DNS hijack.
DNS Flushing vs DNS Scavenging
These two terms get confused, but they describe different things entirely. DNS flushing is a client-side action, something you do on your own device to clear its local cache. DNS scavenging is a server-side technique DNS servers use to automatically clean up outdated or stale resource records in their own zone data. One is a manual troubleshooting step you run; the other is ongoing server maintenance you’d never interact with directly as a regular user.
FAQ
I flushed my DNS but still can’t access the site. What now?
The outdated record is likely still cached upstream, in your router or your ISP’s recursive resolver, neither of which a local flush touches. A router reboot sometimes helps; otherwise the wait is until that upstream cache’s TTL expires naturally.
Does flushing DNS delete my browser history?
No. DNS cache and browser history are separate systems entirely, and clearing one has no effect on the other.
How often should I flush my DNS?
Only when actively troubleshooting a specific connectivity issue. It isn’t a maintenance task that needs to happen on any regular schedule.
