Contents
8 sections · 8 min read
Terminal screen showing ipconfig flushdns command being executed successfully
Domain Management

How to Flush DNS: The Complete Guide for Every Device and OS

A
Domain 360 Team
·July 14, 2026·8 min read

The DNS flush command is one of the most-searched technical fixes on the internet, and for good reason. Whenever a website moves to a new server, changes its domain setup, or returns from an outage, there is a window where some visitors still see the old data sitting in their device DNS cache. The fix is one command — and it works every time.

Here is every version of that command, for every operating system, plus the full picture of when and why to use it.

What Is a DNS Cache and Why Does It Need Flushing?

Every time you visit a website, your device translates the domain name into an IP address using DNS. To avoid doing this lookup every single time, your operating system stores recent results in a local cache. For a couple of hours — sometimes longer, depending on the TTL value the domain owner set — your device skips the fresh lookup and uses the stored result.

This works well until DNS records change. When a website moves to a new server, updates its IP address, or returns after an expired domain is renewed, the DNS records update quickly. But your device keeps serving the old cached result until it expires naturally, which can take hours. Flushing the cache forces the stale entries out immediately, so the next lookup fetches current data.

Windows: ipconfig /flushdns

The command has not changed in years and works on every Windows version.

Step 1. Press Windows key, type cmd. Right-click Command Prompt and choose Run as administrator. The administrator step matters — without it the command may appear to run but does nothing.

Step 2. Type exactly: ipconfig /flushdns and press Enter.

Step 3. You will see: Successfully flushed the DNS Resolver Cache.

That is it. No restart required. DNS cache is cleared immediately.

Windows 11 alternative: PowerShell also works. Open PowerShell as administrator and run: Clear-DnsClientCache. Same result, no output message.

Windows 10 and 11 via Settings: Settings, Network and Internet, Advanced network settings, Hardware and connection properties — some users find a "DNS settings" flush option here, but the command is faster.

After flushing, if the problem was DNS-related, the site should load correctly on the next visit. If it does not, the issue is not your local DNS cache — it is still propagating at the server level, which our guide on DNS propagation covers in detail.

Mac: sudo dscacheutil -flushcache

Mac DNS flushing requires two commands on most modern macOS versions.

Open Terminal. Spotlight search (Cmd + Space), type Terminal, press Enter.

Run both commands: sudo dscacheutil -flushcache sudo killall -HUP mDNSResponder

Enter your Mac password when prompted. macOS does not show a success message — the silence means it worked.

Which macOS version are you on? The two-command approach above works for macOS High Sierra through Sonoma (the current release at time of writing). On some very old versions the command differs slightly, but if your Mac is running a supported macOS, these two commands are correct.

macOS DNS settings location: If you want to change which DNS server you use (separate from flushing cache), go to System Settings, Network, choose your connection, Details, DNS.

Linux: sudo systemd-resolve --flush-caches

Linux varies by distribution and whether systemd-resolved is running.

Ubuntu and most modern Debian-based systems: sudo systemd-resolve --flush-caches

To verify it worked: sudo systemd-resolve --statistics — the "Current Cache Size" should show 0.

If that command is not found: Try sudo /etc/init.d/nscd restart or sudo service dns-clean restart depending on your distribution.

Checking which DNS service is running: systemctl status systemd-resolved confirms whether the systemd resolver is active. On older systems or minimal installs, a different caching daemon may be in use.

Android: Private DNS Toggle

Android does not expose a direct flush command in the user interface. The most reliable method is toggling Private DNS off and back on, which forces a new DNS session.

Go to Settings, Network and internet, Private DNS. Set it to Off, wait a few seconds, then set it back to your preferred option. This clears the in-use DNS state.

Alternatively, toggling airplane mode on and off achieves the same effect by disconnecting and reconnecting to the network entirely.

iOS and iPadOS: Airplane Mode Toggle

Same approach as Android. Toggle airplane mode on, wait five seconds, toggle off. iOS reconnects to the network with a fresh DNS state.

Alternatively, go to Settings, General, Transfer or Reset iPhone, Reset, Reset Network Settings — this also resets Wi-Fi passwords and cellular settings alongside DNS, so use it only if the airplane toggle does not resolve the issue.

Chrome and Other Browsers: The Hidden DNS Cache

Here is one that catches people out: Chrome and Chromium-based browsers have their own internal DNS cache, separate from the operating system. If flushing the OS cache does not fix the issue in Chrome, flush the browser cache too.

Type into Chrome address bar: chrome://net-internals/#dns. Click the Clear host cache button.

On the same page, clicking Sockets and then Flush socket pools clears the connection pool, which can help with persistent SSL errors after DNS changes.

When Flushing DNS Actually Helps (and When It Does Not)

Flushing DNS resolves problems caused by stale cached records — typically: a site returning the wrong page or an old version after a server move, DNS_PROBE_FINISHED_NXDOMAIN errors for domains you know exist, or connection issues immediately after changing your DNS server.

It does not help with: sites that are actually down at the server, browser cache issues (clear browser data separately), issues with the DNS server itself rather than your local cache, or problems caused by an expired domain — which requires renewal rather than a flush. Our guide on domain expiry and what happens next is relevant if you are chasing problems that turn out to be an expired registration.

The distinction matters because flushing DNS is the internet equivalent of clearing your browser history — it removes local data, but it does not change anything on the servers. If DNS records are genuinely wrong or not yet propagated, flushing just makes your device go check the server again, and find the same wrong or missing data.

Never lose a domain again

Track every domain you own in one dashboard. Free for up to 15 domains.