How to Flush DNS: Windows, Mac, Linux, Fedora & Chrome

Key takeaway

Flushing DNS deletes the answers your device has stored for names it looked up, so the next visit asks DNS again. On Windows, run ipconfig /flushdns in Command Prompt. On macOS, run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in Terminal. On Linux with systemd-resolved (Ubuntu, Fedora), run sudo resolvectl flush-caches. In Chrome, open chrome://net-internals/#dns and click Clear host cache. It's safe and only affects your own device.

Check it now

How to flush DNS cache guide showing flush commands for Windows, Mac, Linux, and Chrome browsers
How to flush DNS cache guide showing flush commands for Windows, Mac, Linux, and Chrome browsers
Start reading
  1. Flush DNS Commands at a Glance
  2. How DNS Cache Works: TTL, Cache Levels, and Expiration
  3. When Should You Flush DNS?
  4. How to Flush DNS on Windows 10 and Windows 11
  5. How to Flush DNS on macOS (Every Version Since El Capitan)
  6. How to Flush DNS on Linux (Ubuntu, Fedora, Debian)
  7. How to Flush DNS in Google Chrome
  8. How to Flush DNS in Firefox, Edge, Safari and Others
  9. How to Flush DNS on Android and iPhone
  10. How to Flush DNS on Your Router
  11. How to Verify Your DNS Cache Was Flushed
  12. What to Do If Flushing DNS Does Not Fix the Problem
  13. Frequently Asked Questions

Flush DNS Commands at a Glance

To flush DNS, run one command for your system. Flushing deletes the answers your device has stored for names it looked up recently, so the next visit asks DNS again and gets the current address.

See a domain's current records and TTL

The command for each system:

WhereCommand or setting
Windows 10 and 11ipconfig /flushdns (Command Prompt), or Clear-DnsClientCache (PowerShell)
macOSsudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Linux with systemd-resolved (Ubuntu, Fedora 33+)sudo resolvectl flush-caches
Chrome, Edge, Bravechrome://net-internals/#dns (or edge://, brave://) → Clear host cache
Firefoxabout:networking#dns → Clear DNS Cache
Android and iPhoneTurn Airplane mode on for 10 seconds, then off (or restart)
RouterRestart it

Why bother? DNS records change: a site moves to a new server or host, and your stored answer still points at the old address. Answers from the local cache come back almost instantly, while a lookup that goes out to a resolver took about 30 ms from our home line to Google's 8.8.8.8 (26 October 2026), so caching is worth having until an answer goes stale.

DNS is cached in several places, your browser, your operating system and often your router, so a stubborn stale answer may need flushing at more than one level.

How DNS Cache Works: TTL, Cache Levels, and Expiration

Every DNS record carries a TTL (time to live) set by the domain's owner: how many seconds a cache may keep it. Values usually range from 300 seconds (5 minutes) to 86,400 seconds (24 hours); Cloudflare, for example, uses 300 seconds by default.

Each layer keeps its own copy:

  • Browser — Chrome normally uses its own built-in DNS client (on by default on Windows, macOS, Linux, ChromeOS and Android). It keeps each answer for the record's TTL, at least 60 seconds, and keeps a "doesn't exist" answer for the zone's negative TTL. When it falls back to the operating system's resolver, it keeps answers for 60 seconds and doesn't keep failures (Chromium source). Firefox holds up to 3,200 names and uses 60 seconds when the OS gives no TTL (Firefox prefs).
  • Operating system — Windows' DNS Client service, macOS's mDNSResponder and Linux's systemd-resolved keep answers until their TTL runs out. Some Linux systems (Debian by default, minimal installs) don't cache at all.
  • Router — many home routers run dnsmasq, which caches 150 names by default (dnsmasq manual); OpenWrt raises that to 1,000.
  • Your DNS provider — your ISP's or public resolver's cache serves everyone using it. You can't flush your ISP's, but Google Public DNS and Cloudflare let anyone purge a name from their caches (Google, Cloudflare). Otherwise, wait for the TTL or switch resolver.

Flushing clears the browser and operating-system layers, and restarting the router clears its layer. To skip a stale provider cache, switch to a public resolver such as Cloudflare's 1.1.1.1 or Google's 8.8.8.8. You can see any record's current TTL with DNS Lookup.

When Should You Flush DNS?

Your system expires cached answers on its own, so you don't need to flush on a schedule. Flush when:

  • A site won't load for you but works for others — errors like DNS_PROBE_FINISHED_NXDOMAIN or DNS server not responding
  • You still see a site's old version after it moved to a new server or host
  • You changed DNS servers — for example to Google DNS (8.8.8.8) or Cloudflare (1.1.1.1) — and want the change now
  • A certificate warning appears after a site moved — your stored address still points at the old server and its old certificate
  • You edited DNS records (A, CNAME, MX) and want to see the change before the old TTL runs out. The DNS Propagation Checker shows whether resolvers worldwide have it
  • You suspect a poisoned or hijacked answer — flushing drops it from your caches

How to Flush DNS on Windows 10 and Windows 11

Windows has two ways to flush DNS: Command Prompt and PowerShell. Both clear the Windows DNS Client service's cache. ipconfig /flushdns works on every version, including Windows Server and older releases.

Method 1: Using Command Prompt

  • Step 1 — Press Windows + S, type cmd and open Command Prompt (an ordinary window is enough on current Windows 10 and 11; if Windows says the operation requires elevation, right-click it and choose Run as administrator)
  • Step 2 — Type ipconfig /flushdns and press Enter
  • Step 3 — You should see: "Successfully flushed the DNS Resolver Cache."

That is all it takes. Your Windows DNS cache is now empty, and the next time you visit a website, Windows will query your configured DNS server for a fresh IP address. The ipconfig command is the standard Windows networking utility — /flushdns is just one of its many switches.

Method 2: Using PowerShell

PowerShell has its own DNS cmdlet that provides the same functionality with additional options:

powershell
# Flush the DNS cache
Clear-DnsClientCache

# Verify the cache is empty (should return very few entries)
Get-DnsClientCache

# Count cached entries
Get-DnsClientCache | Measure-Object | Select-Object Count

Clear-DnsClientCache does exactly the same thing as ipconfig /flushdns. The advantage of PowerShell is the Get-DnsClientCache cmdlet, which shows cached entries in a table format that is easier to filter and export than ipconfig /displaydns.

How to Flush DNS on macOS (Every Version Since El Capitan)

On a Mac you flush DNS from Terminal. The same command works on every version from El Capitan (10.11) to today's releases, including macOS 26 Tahoe.

macOS VersionFlush DNS Command
Big Sur (11) and later, including Tahoe (26)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Catalina (10.15) back to El Capitan (10.11)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Yosemite (10.10.4 to 10.10.5)sudo killall -HUP mDNSResponder
Yosemite (10.10 to 10.10.3)sudo discoveryutil mdnsflushcache
Lion (10.7) to Mavericks (10.9)sudo killall -HUP mDNSResponder
  • Step 1 — Press Command + Space to open Spotlight, type Terminal and press Enter
  • Step 2 — Paste sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder and press Enter
  • Step 3 — Enter your Mac password when asked. Terminal shows no output, but the cache is cleared

dscacheutil -flushcache clears the Directory Service cache, and killall -HUP mDNSResponder tells mDNSResponder, the macOS DNS resolver, to drop its cached answers; it doesn't restart the process. Safari has no DNS cache of its own, so this covers Safari too; quit Safari (⌘Q) as well, so it drops connections still open to the old address.

How to Flush DNS on Linux (Ubuntu, Fedora, Debian)

Linux caches DNS only if a caching service runs. Ubuntu and Fedora (33 and later) use systemd-resolved; Debian and minimal installs often have no cache at all, and some systems use dnsmasq or nscd instead.

  • Step 1 — Open a terminal (Ctrl + Alt + T on Ubuntu)
  • Step 2 — Run the command for your DNS service (below)
  • Step 3 — Check it worked: resolvectl statistics should show a current cache size of 0
bash
# Ubuntu, Fedora 33+ and other systemd-resolved systems
sudo resolvectl flush-caches

# Check: "Current Cache Size" should be 0
resolvectl statistics

# Older systemd (before version 239, e.g. Ubuntu 18.04)
sudo systemd-resolve --flush-caches

# dnsmasq
sudo systemctl restart dnsmasq

# nscd
sudo systemctl restart nscd

Not sure which service you run? Run resolvectl status. If it lists your DNS servers, you use systemd-resolved. If the command is missing, or says it can't reach the resolve service, check systemctl status dnsmasq or systemctl status nscd.

How to Flush DNS in Google Chrome

Chrome keeps its own DNS cache, separate from your operating system's (see the cache layers above), so flush both. Here's how:

  • Step 1 — Open a new tab in Chrome
  • Step 2 — Type chrome://net-internals/#dns in the address bar and press Enter
  • Step 3 — Click the Clear host cache button
  • Step 4 — Also go to chrome://net-internals/#sockets and click Flush socket pools to close stale TCP connections that may still be using old IP addresses

For a full refresh, flush the operating system and Chrome. Chrome rebuilds its cache as you browse, so clearing it has no lasting effect on speed.

How to Flush DNS in Firefox, Edge, Safari and Others

Every Chromium browser has the same page under its own prefix; Firefox has its own, and Safari uses the Mac's cache:

BrowserHow to Clear DNS Cache
Microsoft Edgeedge://net-internals/#dns → Clear host cache, then edge://net-internals/#sockets → Flush socket pools
Firefoxabout:networking#dns → Clear DNS Cache. Firefox keeps up to 3,200 names, for 60 seconds when the OS gives no TTL
Safari (Mac)No DNS cache of its own: flush macOS (above). Develop → Empty Caches clears web pages, not DNS
Brave, Opera, Vivaldibrave://net-internals/#dns, opera://net-internals/#dns or vivaldi://net-internals/#dns → Clear host cache

How to Flush DNS on Android and iPhone

Phones have no flush command. Reconnecting does the job:

  • Turn Airplane mode on, wait 10 seconds, and turn it off. The phone rebuilds its network connections and their DNS caches.
  • Still stale? Restart the phone. On Android, also check Settings → Network & internet → Private DNS (on Samsung, Connections → More connection settings): a provider hostname set there answers every lookup, whatever the Wi-Fi uses.
  • On Wi-Fi, the router's cache still applies, so restart the router too if one site keeps failing on every device.

How to Flush DNS on Your Router

Your home router also caches DNS responses for all devices on the network. If you have flushed the DNS cache on your computer and browser but still see stale records, the router cache may be the culprit.

Most consumer routers do not have a dedicated DNS flush command. The simplest way to clear the router's DNS cache is to restart it:

  • Step 1 — Unplug your router's power cable (do not just press the reset button — that factory-resets the router)
  • Step 2 — Wait about 30 seconds so it powers down fully
  • Step 3 — Plug the power cable back in and wait 1-2 minutes for the router to fully boot
  • Step 4 — Reconnect to Wi-Fi if needed and verify the issue is resolved

Routers that run dnsmasq, such as OpenWrt, can clear it over SSH with /etc/init.d/dnsmasq restart, without a full reboot.

For ongoing DNS trouble, set your router to a public resolver such as Cloudflare (1.1.1.1) or Google (8.8.8.8), so every device uses it. Our guide to fixing slow DNS lookups has the steps.

How to Verify Your DNS Cache Was Flushed

After flushing, check that the cache is empty, or that your system now resolves the new address:

bash
# Windows: lists what's cached (only a few entries right after a flush)
ipconfig /displaydns

# Windows PowerShell: count cached entries
(Get-DnsClientCache).Count

# macOS: the address your Mac resolves now
dscacheutil -q host -a name example.com

# Linux (systemd-resolved): "Current Cache Size" should be 0
resolvectl statistics

Then try the site that was failing. To compare what your machine gets with what DNS really says, look the domain up with DNS Lookup.

To see whether the problem is your cache or the records themselves, run the domain through the DNS Propagation Checker: it asks 34 resolvers in 28 countries at once. If they all have the new address and you don't, your cache or resolver is behind.

What to Do If Flushing DNS Does Not Fix the Problem

Flushing fixes stale answers, but not every DNS problem is a stale answer. If the problem survives a flush of your device, browser and router:

  • Switch DNS servers — your ISP's resolver may be down or returning old records. Try Cloudflare (1.1.1.1) or Google (8.8.8.8); our slow DNS lookup guide has the steps
  • Check whether the site is down — the Website Down Checker opens it from 11 places. If it fails everywhere, it isn't your cache or your resolver
  • Check the records — look up the domain's A, AAAA and CNAME records with DNS Lookup. If they point at the wrong IP, only the domain's owner can fix them
  • Disconnect a VPN or proxy — VPNs send DNS through their own servers, which keep their own cache
  • Check your hosts file — C:\Windows\System32\drivers\etc\hosts on Windows, /etc/hosts on macOS and Linux. Remove entries for the affected domain
  • Give a recent change time — each resolver picks up a changed record when its old copy's TTL runs out: minutes for short TTLs, up to a day or two for long ones

Check your DNS records now

See every record straight from the domain's own nameservers, beside what Google and Cloudflare have cached, with the TTL left on each.

Sources

  1. ipconfig, Microsoft
  2. host_resolver_manager_job.cc (Chrome's DNS cache times), Chromium
  3. dnsmasq manual (default cache size), dnsmasq

Frequently Asked Questions

What does flushing DNS do?

It deletes the name-to-IP answers your device has stored, so the next time you visit a site, your system asks a DNS server again and gets the current address instead of a possibly outdated one.

Is it safe to flush DNS?

Yes. It doesn't delete files, change settings or disconnect you. The only side effect is that the first visit to each site afterwards waits for one fresh lookup, typically a fraction of a second (about 30 ms in our own test to 8.8.8.8).

What is the flush DNS command for Windows?

Open Command Prompt and run ipconfig /flushdns (an ordinary window is enough on current Windows 10 and 11; if Windows says the operation requires elevation, use Run as administrator). You'll see "Successfully flushed the DNS Resolver Cache." In PowerShell, Clear-DnsClientCache does the same.

What is the flush DNS command for Mac?

Open Terminal and run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, then enter your password. It works on every macOS from El Capitan to today's releases, and it covers Safari, which has no DNS cache of its own.

How do I flush DNS on Fedora?

Fedora 33 and later use systemd-resolved, so run sudo resolvectl flush-caches, then resolvectl statistics to check the current cache size is 0. If a browser still shows the old address, clear its cache too (chrome://net-internals/#dns in Chrome, about:networking#dns in Firefox).

How often should I flush DNS?

There's no need to flush on a schedule: cached answers expire on their own when their TTL runs out, typically after 5 minutes to 24 hours. Flush only when something is wrong, such as a site not loading or showing an old version.

Why do I need to flush both the system and the browser?

Because they keep separate caches, and flushing one doesn't clear the other. Flush the system first (ipconfig /flushdns on Windows), then the browser (chrome://net-internals/#dns in Chrome), and restart the router if every device is affected.

Does flushing DNS make the internet faster?

No. Right after a flush, each site needs one fresh lookup, so it's very slightly slower. Flushing only helps when a stale answer was sending you to the wrong server. For faster lookups, switch to a quicker resolver.

Does restarting my computer flush DNS?

Yes. Windows, macOS and systemd-resolved keep their DNS caches in memory, so a restart clears them. On Windows, choose Restart rather than Shut down: with Fast Startup on, Shut down can resume the old session. Quitting the browser completely also clears its in-memory DNS cache.

How do I flush DNS on my router?

Most home routers have no flush button: restart the router by unplugging it for 30 seconds, which clears its memory, cached DNS included. Routers running dnsmasq, such as OpenWrt, can clear it with /etc/init.d/dnsmasq restart over SSH.

About the author

Shaik Vahid

Founder of DNS Robot. Vahid spent years in web hosting support fixing domains, DNS records, SSL certificates and email delivery for customers. He builds DNS Robot's tools and writes these guides from the errors people actually hit.

DNS Lookup

Every DNS record from the domain's own nameservers, beside Google's and Cloudflare's cache