Back to Blog•
October 29, 2026
•
9 min

How to flush DNS on any device and clear your DNS cache

Copy-ready commands to flush DNS on Windows, Mac and Linux, plus steps for browsers, phones and routers and fixes for common errors.

To flush DNS on Windows, open Command Prompt and run ipconfig /flushdns. On a Mac, you run two Terminal commands. Linux needs just one. Browsers and phones have their own quick steps. All the commands are in the cheat sheet below, followed by step-by-step guides, ways to check that it worked and fixes for common errors.

DeviceWhereCommand or step
Windows 11 / 10Command Prompt
ipconfig /flushdns
Mac (macOS)Terminal
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
Linux (systemd)Terminal
sudo resolvectl flush-caches
ChromeAddress bar
chrome://net-internals/#dns
EdgeAddress bar
edge://net-internals/#dns
FirefoxAddress bar
about:networking#dns
iPhone / AndroidSettingsTurn Airplane Mode on, then off

On Mac and Linux, enter your password when asked. In the browser, click the clear button on the page that opens.

What is DNS cache?

In short, DNS cache is a list your device keeps of the websites it has looked up recently and their IP addresses. DNS (Domain Name System) works like a phone book. It turns a name such as example.com into the number your device needs to connect.

Looking up every name from scratch would slow you down. That's why your device saves each answer for a while. How long depends on the TTL (time to live) that the site's owner sets, which can be a few minutes or a full day. Your browser, your operating system and your router can each keep their own copy.

What does flushing DNS do?

When you flush the DNS cache, your device deletes those saved answers. As a result, the next time you open a site, your device asks a DNS server again and gets the current address. Nothing else changes. Your files, passwords and browser history stay where they are.

A DNS flush helps in a few common cases:

  • A site moved to a new server and you still land on the old one.
  • You see errors like DNS_PROBE_FINISHED_NXDOMAIN or "server IP address could not be found" while other devices load the site fine.
  • You changed your DNS server, for example to 1.1.1.1 or 8.8.8.8.
  • You just connected or disconnected a VPN and some sites behave oddly.

Your device also clears this cache when it restarts. A flush, however, does the same thing without rebooting.

How to flush DNS on Windows 11 and 10

Windows needs just one command. It works the same on Windows 11 and Windows 10.

  1. Press the Windows key, type cmd and open Command Prompt. If you get an error later, right-click it and choose Run as administrator.
  2. Type ipconfig /flushdns and press Enter.
  3. Look for the message "Successfully flushed the DNS Resolver Cache."

According to Microsoft's ipconfig reference, the command "flushes and resets the contents of the DNS client resolver cache". If you prefer PowerShell, Clear-DnsClientCache does the same job without any message.

To see what was in the cache before you flush it, run ipconfig /displaydns. It lists every site name your PC has resolved lately.

How to flush DNS on Mac

On a Mac, the job takes two Terminal commands. Both work on all recent macOS versions.

  1. Open Terminal from Applications > Utilities or find it with Spotlight.
  2. Run sudo dscacheutil -flushcache and press Enter.
  3. Run sudo killall -HUP mDNSResponder and press Enter.
  4. Enter your Mac password when asked. The characters won't show as you type.

Also, don't expect a confirmation. Both commands finish silently. That's normal. The first clears the cache. The second restarts the macOS service that handles DNS lookups. That way it starts fresh. Some guides still list different commands for older versions such as Yosemite. You only need them on a Mac that hasn't been updated in more than ten years.

How to flush DNS on Linux

On most current Linux systems, sudo resolvectl flush-caches clears the DNS cache. That covers Ubuntu, Fedora and other distributions that use systemd-resolved.

Then, to check that it worked, run resolvectl statistics. "Current Cache Size" should show 0 right after the flush.

Some systems use a different cache service:

  • With nscd, run sudo systemctl restart nscd.
  • With dnsmasq, run sudo systemctl restart dnsmasq.

Not sure which one you have? First, run systemctl status systemd-resolved. If it shows "active (running)", resolvectl is the right command. Many minimal installs don't cache DNS at all. In that case there's nothing to flush.

How to clear DNS cache in Chrome, Edge, Firefox and Safari

Browsers can also keep their own cache on top of the system one. So if one site still won't load after a system flush, clear the browser's cache too.

  • Chrome. Go to chrome://net-internals/#dns and click "Clear host cache". Then open chrome://net-internals/#sockets and click "Flush socket pools" to drop open connections.
  • Edge. Use the same steps with edge://net-internals/#dns and edge://net-internals/#sockets.
  • Firefox. Go to about:networking#dns and click "Clear DNS Cache".
  • Safari. There's no separate page. Safari uses the macOS cache. So the Mac commands above clear it too.

Keep in mind that you have to type these addresses into the address bar yourself. Most browsers won't open them from a link.

How to clear DNS cache on iPhone and Android

Phones have no flush command. Still, two simple steps usually clear the cache.

On an iPhone, turn Airplane Mode on, wait about 10 seconds and turn it off. If that doesn't help, then restart the phone.

On Android, the same Airplane Mode trick works too. In Chrome for Android, you can also open chrome://net-internals/#dns and click "Clear host cache". If you use a custom DNS provider, you'll find it under Private DNS in the network settings. The exact path depends on the phone maker.

How to clear DNS on your router and public DNS servers

Your router often keeps its own copy for the whole home network. Restarting it clears that copy for every device at home. Unplug it for about 30 seconds, then plug it back in.

Public DNS services cache answers too. Two of the big ones let anyone refresh a single domain:

  • Google Public DNS has a flush cache tool. You enter a domain and record type and solve a captcha.
  • Cloudflare's 1.1.1.1 has a purge cache tool that clears a domain from its cache within a few seconds.

These tools mostly help site owners after changing DNS records. So as a regular user, you'll rarely need them.

How to check that the DNS flush worked

The fastest check is simply to open the site that caused trouble. If it loads, you're done. For a closer look, use one of these:

  • On Windows, run ipconfig /displaydns. Right after a flush, the list should be almost empty.
  • On Linux, run resolvectl statistics and check that the cache size is 0.
  • On any system, run nslookup followed by the site's name, for example nslookup example.com. Then compare the IP address with the one the site's owner or a public DNS lookup site shows.

But if nslookup still returns an old address, the stale record sits on your DNS server, not on your device. The "When flushing DNS won't help" section below covers that case.

DNS flush errors and how to fix them

In most cases, the problem is missing permissions or a changed page in the browser. Here's what to do for each:

What you seeWhyWhat to do
"The requested operation requires elevation" (Windows)Command Prompt runs without admin rightsRight-click Command Prompt and choose Run as administrator
"Could not flush the DNS Resolver Cache" (Windows)The DNS Client service isn't respondingRestart the PC, then run the command again
"ipconfig is not recognized" (Windows)A typo or the wrong appCheck the spelling and use Command Prompt or PowerShell
No message after the Mac commandsNothing is wrong. macOS doesn't confirmOpen the site again to check
"Unit dnsmasq.service not found" (Linux)Your system uses a different cache serviceTry sudo resolvectl flush-caches
No "Clear host cache" button in ChromeThe page moved or changed in a new versionFlush socket pools, then restart Chrome
The site still won't loadThe old address sits on your DNS server or routerRestart the router or switch DNS servers

Messages are shown as they appear on screen.

When flushing DNS won't help

A flush only clears copies on your own devices. Because of that, it can't fix problems further along the way.

  • The site is down. Check it from another network, such as mobile data.
  • DNS changes haven't spread yet. After a site moves, your internet provider's DNS server may keep the old address until the TTL runs out. Switching to another DNS server is faster than waiting.
  • The network blocks the site. Work, school and public Wi-Fi networks often filter sites through DNS. Our VPN unblock guide explains when a VPN gets around that and when it doesn't.
  • The hosts file overrides DNS. An entry there wins over any DNS answer. A flush doesn't remove it.

DNS cache, privacy and VPNs

Your DNS cache is also a quiet record of where you've been online, which matters for privacy. For example, anyone with access to your computer can run ipconfig /displaydns and see which sites it visited lately. Clearing your browser history doesn't touch this list. A flush closes that gap.

Flushing matters with a VPN as well. When you connect, your DNS lookups should go through the VPN tunnel. Old cached answers from your internet provider can still send some sites to the wrong place for a while. Flushing after you connect or switch DNS servers gives you a clean start. Our guide on whether a VPN can be tracked shows how to test for DNS leaks, where lookups slip outside the tunnel. If DNS trouble makes your VPN drop, see why your VPN keeps disconnecting.

How Atomic VPN keeps your DNS lookups private

A flush cleans up your device. However, it does nothing about who sees your lookups while you browse. Normally that's your internet provider or the owner of the Wi-Fi network. Atomic VPN handles that part:

  • DNS leak protection keeps your lookups inside the encrypted tunnel.
  • An audited no-log policy. We don't store DNS queries, connection timestamps, assigned IP addresses or browsing history.
  • A kill switch on Windows, macOS and Android blocks traffic if the VPN drops. Your lookups don't fall back to your provider.

The yearly plan is $1.99 a month, billed $23.99 once a year. It renews at the same price. Apps are available for Windows, macOS and Android. The iOS app is coming soon.

Keep your DNS lookups private

DNS leak protection, a kill switch and an audited no-log policy that covers DNS queries. $1.99 a month on the yearly plan, billed $23.99 once a year.

Questions and answers

Is it safe to flush DNS?

Yes. A DNS flush only deletes temporary lookups that your device rebuilds on its own. It doesn't delete files, passwords or settings. The only side effect is that the first visit to each site afterward takes slightly longer.

How often should I flush DNS?

Only when something's wrong, for example a site that won't load or points to an old server. Your device clears old entries on its own when their time runs out. There's no benefit to flushing on a schedule.

Does flushing DNS delete browsing history?

No. Your browser history stays as it is. A flush only clears the list of recently looked-up site names, which some people see as a privacy bonus.

Does flushing DNS speed up the internet?

Not in general. It can fix a site that loads slowly or not at all because of a bad cached record. For everyday browsing, the cache actually makes things a little faster.

Do I need admin rights to flush DNS?

On a Mac and on Linux, yes, because the commands use sudo. On Windows, ipconfig /flushdns usually works in a normal Command Prompt. If it doesn't, run Command Prompt as administrator.

Does restarting a computer clear the DNS cache?

Yes. The system DNS cache lives in memory. A restart clears it on Windows, macOS and Linux. Flushing gets the same result without closing your apps.

Apps for everything you own

Windows icon
Windows
Download
Google Play icon
Android
Download
App Store icon
iOS
Coming soon
Android TV icon
Android TV
Coming soon
Chrome icon
Chrome
Coming soon
Firefox icon
Firefox
Coming soon
Linux icon
Linux
Coming soon

Stay private on any Wi‑Fi

One account, five devices, 88+ countries. From $1.99 a month on the yearly plan, cancel in one click.