Network security

How to Flush DNS: Windows, Mac, Linux & Browser Cache (2026 Guide)

Flushing DNS clears stale lookup results so your device asks for fresh answers. Here is the one command for every system, and when it actually helps.

Cysoro Security TeamPublished · 7 min read
C:\> ipconfig /flushdns Windows IP Configuration Successfully flushed the DNS Resolver Cache. Cache cleared NETWORK SECURITY FlushDNS One command for every system.
Quick answer

To flush DNS on Windows, open Command Prompt as administrator and run ipconfig /flushdns. On macOS, run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in Terminal. On Linux with systemd-resolved, run sudo resolvectl flush-caches. In Chrome or Edge, open chrome://net-internals/#dns and click Clear host cache. Flushing deletes stored lookup results so the next visit fetches the current address.

Key takeaways

  • Flushing DNS deletes stored lookup results so your device fetches the current address for a website.
  • The command is one line per system: ipconfig /flushdns on Windows, a dscacheutil pair on macOS, resolvectl on Linux.
  • Flushing fixes stale DNS records and some loading errors, but it cannot fix a down website, a bad connection or a wrong DNS server.

You changed a website's DNS, or a site moved to a new server, but your computer keeps loading the old address. The cause is usually the DNS cache: your device remembers recent lookups so it does not have to ask again. Flushing it takes one command, and this guide gives you the right one for every system.

What is the DNS cache, and what does flushing it do?

The DNS cache is your device's short-term memory for name lookups. When you visit a site, your device stores the answer — the IP address for that domain name — so the next visit is instant instead of requiring another lookup.

Flushing DNS deletes those stored answers. The next time you visit a site, your device asks DNS again and gets the current address. It does not change your DNS server, your IP address or any settings, and the cache rebuilds itself automatically as you browse. You can see what your current DNS setup returns with our free DNS lookup tool.

Cached entries expire on their own when their time-to-live (TTL) runs out, so flushing is a shortcut, not a routine chore. You need it when the cached answer is wrong and you do not want to wait for it to expire.

When should you flush DNS?

Flush DNS when you have a reason to believe the cached answer is stale or wrong. The most common cases are a website that moved servers, DNS records you just changed, and a site that loads an old version after a migration.

SituationFlush DNS?Why
Website moved to a new serverYesYour cache may still point at the old IP address
You changed DNS recordsYesOld records linger until the TTL expires
Site shows an old version after a migrationYesStale cache is the usual cause
DNS error (DNS_PROBE_FINISHED_NXDOMAIN)Try itA poisoned or stale entry can cause it
Website is down for everyoneNoFlushing cannot bring a server back
Slow internet or Wi-Fi problemsNoThat is a connection problem, not a cache problem
Routine maintenanceNo needEntries expire automatically when the TTL runs out

If flushing does not fix the problem, the cause is elsewhere: the site may be down, your DNS server may be wrong, or your router may need a restart. The troubleshooting section at the end of this guide walks through those cases.

How do I flush DNS on Windows?

On Windows 10 and 11, open Command Prompt as administrator and run ipconfig /flushdns. You should see the message "Successfully flushed the DNS Resolver Cache."

Flush DNS: one command per system Windows (Command Prompt, as administrator) ipconfig /flushdns macOS (Terminal) sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder Linux with systemd-resolved (Terminal) sudo resolvectl flush-caches PowerShell alternative on Windows: Clear-DnsClientCache
The flush DNS command for Windows, macOS and Linux. Illustration by Cysoro.
  1. Press the Windows key, type cmd, right-click Command Prompt and choose "Run as administrator".
  2. Type ipconfig /flushdns and press Enter.
  3. Wait for the confirmation message: "Successfully flushed the DNS Resolver Cache."
  4. Close Command Prompt and reload the site.

The same command works on Windows 10, 8 and 7, and on Windows Server. In PowerShell, the equivalent is Clear-DnsClientCache. Microsoft documents ipconfig in its ipconfig command reference.

If the site still loads the old address, also flush the browser cache (see below) and try ipconfig /displaydns to see what is currently cached.

How do I flush DNS on macOS?

On macOS, open Terminal and run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, then enter your administrator password when prompted. The first part clears the directory service cache, and the second tells the system DNS service to drop its cached entries.

  1. Press Command + Space to open Spotlight, type Terminal and press Enter.
  2. Paste the command sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder and press Enter.
  3. Enter your administrator password when prompted. There may be no confirmation message, which is normal.
  4. Quit and reopen your browser, then reload the site.

This command works on every macOS version from El Capitan (10.11) to current releases, including macOS 26 Tahoe. Older versions used different commands: Yosemite used sudo discoveryutil mdnsflushcache, and Lion through Mavericks used sudo killall -HUP mDNSResponder alone. Safari has no separate DNS cache to clear, so flushing the system cache and reopening Safari is enough.

How do I flush DNS on Linux?

Linux has no single built-in DNS cache, so the command depends on which caching service your system runs. On most current Ubuntu, Debian and Fedora desktops, which use systemd-resolved, run sudo resolvectl flush-caches — the same command recommended in RunCloud's step-by-step guide for modern Ubuntu systems.

Your setupCommandCheck it worked
systemd-resolved (Ubuntu 22.04+, Fedora 33+)sudo resolvectl flush-cachesresolvectl statistics shows cache size 0
Older systemd-resolved (Ubuntu 18.04–20.04)sudo systemd-resolve --flush-cachessystemd-resolve --statistics
dnsmasqsudo systemctl restart dnsmasqService restarts cleanly
nscdsudo nscd -i hosts or restart the serviceService restarts cleanly
No caching serviceNothing to flushCheck with resolvectl status

Flushing the wrong service does nothing, and on a system with no caching service there is nothing to flush at all. If you are not sure which service you run, check with resolvectl status or systemctl status systemd-resolved first.

How do I flush DNS in Chrome, Edge and Firefox?

Browsers keep their own DNS cache on top of the operating system's, so a site can still load the old address after you flush the system cache. Clear both if a site is stubborn.

  • Chrome: type chrome://net-internals/#dns in the address bar and click "Clear host cache". Also clear the socket pools at chrome://net-internals/#sockets by clicking "Flush socket pools".
  • Edge: type edge://net-internals/#dns and click "Clear host cache", the same as Chrome.
  • Firefox: type about:networking#dns in the address bar to view the cache, and clear it from Settings, Privacy and Security, under Cookies and Site Data, by clicking "Clear Data". Firefox also respects the operating system cache, so flush that too.
  • Safari: Safari has no separate DNS cache. Flush the macOS system cache and reopen Safari.

After clearing the browser cache, close and reopen the browser before testing the site again — a tab that is already open may keep using the old connection.

Can you flush DNS on iPhone and Android?

There is no flush DNS command on iPhone or Android, but you can clear the cache with the same effect. On iPhone, turn Airplane Mode on for about 10 seconds and then off, which forces the phone to reconnect and drop cached network state. Restarting the phone clears the cache completely.

On Android, the equivalent is to restart the phone, or to toggle Airplane Mode the same way. In Chrome on Android, you can also open chrome://net-internals/#dns and tap "Clear host cache", just as on desktop. If the problem is your home Wi-Fi rather than the phone, restart the router too — our guide to securing your Wi-Fi and home network covers router basics.

What if flushing DNS does not fix it?

If the site still loads the wrong address after flushing both the system and browser caches, the problem is not the cache. Work through these checks in order.

Flushed DNS and it still does not work? 1. Is the site down for everyone? Check from another network or device 2. Try another DNS server, such as 8.8.8.8 or 1.1.1.1 3. Check the hosts file for a hardcoded wrong entry 4. Restart the router — it has a DNS cache too 5. Wait out the TTL — some records take hours to expire
Five checks to run when flushing DNS does not fix the problem. Illustration by Cysoro.
  1. Check whether the site is down for everyone. Try it from another device or network, such as mobile data instead of Wi-Fi.
  2. Try a different DNS server. Switch temporarily to a public resolver such as Google's 8.8.8.8 or Cloudflare's 1.1.1.1 to see whether your usual DNS server is the problem.
  3. Check the hosts file. A hardcoded entry in the hosts file overrides DNS entirely. On Windows it is at C:\Windows\System32\drivers\etc\hosts; on macOS and Linux it is at /etc/hosts.
  4. Restart the router. Routers keep their own DNS cache, and a stale entry there affects every device on the network.
  5. Wait out the TTL. If a DNS record was changed with a long TTL, some resolvers will keep the old answer for hours no matter what you flush locally. Our DNS lookup tool shows the current records and their TTL values.
Do not flush DNS to fix a hacked siteIf a familiar site suddenly looks different, asks for a password it never asked for, or shows a certificate warning, stop. That can be DNS hijacking or a phishing page, not a stale cache. Check the address carefully and run the site through our SSL checker before you log in.

The bottom line

Flushing DNS is a one-command fix for one specific problem: a stale cached lookup. On Windows it is ipconfig /flushdns, on macOS it is the dscacheutil and mDNSResponder pair, and on Linux it is resolvectl flush-caches. Clear the browser cache too if the site is stubborn.

If flushing does not help, the cause is elsewhere — a down site, a wrong DNS server, a hosts file entry or a router cache. Check those before you spend more time on the cache, and use the free DNS lookup tool to see what the internet actually returns for the domain.

Frequently asked questions

What does flushing DNS do?

Flushing DNS deletes the stored answers your device keeps for names it looked up recently. The next time you visit a site, your device asks DNS again and gets the current address instead of reusing a stale one. It does not change your DNS server, your IP address or any settings.

Is it safe to flush DNS?

Yes. Flushing DNS is a small, safe operation that only clears cached lookup results. Your device rebuilds the cache automatically as you browse. The only effect you may notice is that the first visit to a site takes a fraction of a second longer while the lookup runs again.

How do I flush DNS on Windows 11?

Open Command Prompt as administrator by searching for cmd, right-clicking it and choosing Run as administrator. Type ipconfig /flushdns and press Enter. You should see the message Successfully flushed the DNS Resolver Cache. The same command works on Windows 10, 8 and 7.

How do I flush DNS on a Mac?

Open Terminal and run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, then enter your administrator password. This works on macOS El Capitan (10.11) through current releases, including macOS 26 Tahoe. There is no confirmation message on some versions, which is normal.

How do I flush DNS on Linux?

It depends on which caching service your system runs. On most current Ubuntu, Debian and Fedora desktops, which use systemd-resolved, run sudo resolvectl flush-caches. On older systems the command is sudo systemd-resolve --flush-caches. For dnsmasq or nscd, restart the service instead.

How do I flush DNS in Chrome?

Type chrome://net-internals/#dns in the address bar and click Clear host cache. In Edge, use edge://net-internals/#dns instead. This clears only the browser's own DNS cache, not the operating system's, so do both if a site still loads the old address.

Will flushing DNS fix my internet?

Sometimes. Flushing DNS fixes problems caused by stale or poisoned cache entries, such as a site loading an old server or showing a DNS error after the site moved. It will not fix a down website, a broken router, a wrong DNS server setting or a slow connection.

How often should I flush DNS?

There is no need to flush DNS on a schedule. Do it when you have a reason: a website moved servers, you changed DNS settings, a site loads an old version, or you are troubleshooting a DNS error. Your operating system already expires cached entries automatically when their time-to-live runs out.

Sources

  1. Microsoft Support — ipconfig command reference
  2. RunCloud — How to Flush DNS Cache: A Full Step-by-Step Guide
  3. CC.LA — How to Flush Your DNS Cache: Windows, macOS, Linux, and Browsers
  4. DNS Robot — How to Flush DNS: Windows, Mac, Linux, Fedora & Chrome
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against Microsoft's ipconfig documentation and current step-by-step guides for Windows, macOS, Linux and browsers.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free