You updated a DNS record, waited out the TTL, and the new IP still refuses to load in your browser. Or a site that moved hosts weeks ago keeps hitting a dead server. Nine times out of ten the culprit is a stale DNS cache sitting on your own device, quietly serving outdated answers without asking the resolver for a fresh copy. Flushing that cache takes under a minute on every major platform, and it is one of the first fixes any network engineer reaches for. This guide covers Windows 10 and 11, macOS Ventura through Sequoia, every major Linux distribution, Android, and iOS with exact commands and clicks so you can stop guessing and start fixing.

Why Your Device Caches DNS at All

Every DNS record carries a Time To Live value, measured in seconds, that tells resolvers how long they may store the answer before fetching a fresh one. Your operating system runs a local DNS resolver cache that honours those TTLs so repeated lookups to the same domain do not generate network traffic every single time. That is normally a performance win. The problem arises when a record changes before its TTL expires, or when a previous failed lookup gets cached as a negative answer and stubbornly blocks access even after the real record is in place. Flushing the cache tells the OS to discard every stored answer and start fresh from the authoritative nameservers.

Before flushing locally, confirm the record is actually live in the wild. Use the DNS Propagation Checker to see whether nameservers around the world are already returning the new value.

Flush DNS Cache on Windows 10 and Windows 11

Windows caches DNS through the DNS Client service. The flush command is identical across Windows 10 and 11.

Using Command Prompt

  1. Press Windows + R, type cmd, then press Ctrl + Shift + Enter to open an elevated Command Prompt.
  2. Run the flush command:
ipconfig /flushdns

You should see: Successfully flushed the DNS Resolver Cache. If you see an error about the DNS Client service, it may be disabled. Re-enable it in services.msc by finding DNS Client, right-clicking, and setting Startup type to Automatic.

Bonus: Check the Cache Before and After

To see what is currently cached before you flush, run:

ipconfig /displaydns

After flushing, run it again and the list will be empty. You can also register the machine's own DNS records back to the server in one step:

ipconfig /flushdns ipconfig /registerdns

Using PowerShell

On Windows 8 and later, PowerShell offers a more granular DNS cmdlet:

Clear-DnsClientCache

To confirm the cache is empty:

Get-DnsClientCache

An empty result set means the flush worked.

Flush DNS Cache on macOS

Apple has changed the flush command several times across macOS releases. Use the one that matches your version.

macOS Ventura, Sonoma, and Sequoia (13, 14, 15)

  1. Open Terminal from Applications > Utilities or via Spotlight.
  2. Run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

You will be prompted for your administrator password. There is no success message on modern macOS, which is normal. The two commands together flush the directory service cache and send a hang-up signal to mDNSResponder, forcing it to reload.

macOS Monterey (12) and Big Sur (11)

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Same command, same behaviour.

macOS Catalina, Mojave, High Sierra (10.15, 10.14, 10.13)

sudo killall -HUP mDNSResponder

Older macOS Versions (10.10 Yosemite and 10.11 El Capitan)

sudo discoveryutil mdnsflushcache sudo discoveryutil udnsflushcaches

If you are running anything older than High Sierra in production, a security review is overdue, but the commands above will still handle the DNS flush.

Flush DNS Cache on Linux

Linux does not cache DNS at the kernel level by default. Whether a cache exists depends entirely on which local resolver daemon is running, and that varies by distribution.

systemd-resolved (Ubuntu 18.04+, Fedora, Arch, Debian 12+)

Most modern distributions use systemd-resolved. Check if it is active first:

systemctl is-active systemd-resolved

If the output is active, flush with:

sudo resolvectl flush-caches

Older systemd versions used a different subcommand:

sudo systemd-resolve --flush-caches

Verify the cache was cleared:

resolvectl statistics

Look for Current Cache Size: 0 in the output.

nscd (Name Service Cache Daemon)

Some older Red Hat, CentOS, and Debian setups use nscd instead:

sudo systemctl restart nscd

Or if systemctl is not available:

sudo service nscd restart

dnsmasq

If your system or router uses dnsmasq as a local resolver, send it SIGHUP:

sudo killall -HUP dnsmasq

Or restart the service cleanly:

sudo systemctl restart dnsmasq

No Caching Daemon Running

Some minimal Linux installs forward every query directly to the DNS server in /etc/resolv.conf with no local cache at all. In that case there is nothing to flush. Confirm by checking /etc/nsswitch.conf and looking for a dns entry, then verifying none of the above services are running.

Flush DNS Cache on Android

Android does not expose a direct flush command to end users without root access. There are three practical workarounds that work on stock Android.

Toggle Airplane Mode

  1. Pull down the notification shade.
  2. Tap Airplane Mode to enable it. Wait five seconds.
  3. Tap Airplane Mode again to disable it.

This tears down and rebuilds all network connections, clearing the in-memory DNS cache maintained by the network stack.

Clear Chrome Browser DNS Cache

If the issue is browser-specific, Chrome on Android maintains its own DNS cache separate from the OS:

  1. Open Chrome and navigate to chrome://net-internals/#dns
  2. Tap Clear host cache.
  3. Then go to chrome://net-internals/#sockets and tap Flush socket pools.

Change Private DNS Setting

On Android 9 and later, toggling the Private DNS setting forces the resolver to reconnect:

  1. Go to Settings > Network & Internet > Private DNS.
  2. Switch from Automatic to Off, then back to Automatic.

Flush DNS Cache on iPhone and iPad (iOS and iPadOS)

Apple does not provide a native DNS flush option in iOS. The following methods reliably clear the DNS cache on iPhones and iPads running iOS 14 through iOS 18.

Toggle Airplane Mode

  1. Open Control Center (swipe down from the top-right corner).
  2. Tap the Airplane Mode icon. Wait ten seconds.
  3. Tap it again to reconnect.

Reset Network Settings

This is the nuclear option. It clears DNS cache, Wi-Fi passwords, VPN configurations, and cellular settings. Use it only if simpler methods fail:

  1. Go to Settings > General > Transfer or Reset iPhone > Reset.
  2. Tap Reset Network Settings and enter your passcode.

Safari DNS Cache

Safari does not expose chrome://net-internals, but you can clear its DNS-adjacent cache through:

  1. Settings > Safari > Clear History and Website Data.

Flush DNS in the Browser Itself

Even after the OS cache is cleared, your browser may still be holding onto stale DNS entries. Both Chrome and Edge have a built-in DNS cache that sits on top of the OS resolver.

Google Chrome and Microsoft Edge

chrome://net-internals/#dns edge://net-internals/#dns

Open either URL, click Clear host cache, then visit #sockets and click Flush socket pools. Do both steps or the socket pool will re-use old connections even with fresh DNS data.

Firefox

Firefox uses its own DNS-over-HTTPS resolver when configured. To clear it:

  1. Type about:networking#dns in the address bar.
  2. Click Clear DNS Cache.

How to Verify the Flush Worked

Flushing the cache is only half the job. Confirm the new DNS record is actually resolving correctly after the flush with a direct query:

nslookup example.com 8.8.8.8 dig example.com @1.1.1.1

The first command uses Google's public resolver, bypassing your local cache entirely. The second uses Cloudflare. If both return the expected IP address, your authoritative DNS is fine and the local flush should now let your browser reach the right server. Use the DNS Lookup tool to run the same check from multiple global vantage points without installing any software.

How to Prevent Stale DNS Cache Problems

Flushing manually every time a DNS change is made is tedious. A few practices dramatically reduce how often you run into this problem.

  • Lower the TTL before making changes. At least 24 hours before a planned migration, drop your record TTLs to 300 seconds (five minutes). That way, even if devices cache the old answer just before your change goes live, they will pull the new one within five minutes. After the migration is confirmed stable, raise the TTL back to 3600 or higher.
  • Use a short TTL on records that change frequently. Dynamic IPs, blue-green deployments, and failover setups should carry TTLs of 60 to 300 seconds at most.
  • Avoid negative caching traps. A failed lookup for a name that did not exist at query time gets cached as a negative entry for the SOA record's minimum TTL. If you create the record after that lookup, you may still get NXDOMAIN from cache. Flushing clears negative entries too.
  • Configure your DNS resolver server, not just the client. If your office or home network routes DNS through a router or local DNS server, that layer also caches records. Flush it there as well, or its cached answers will affect every device behind it.
  • Document TTL changes in change management logs. When something breaks after a DNS change, the first question is always what the TTL was set to at the time. Knowing that number tells you exactly how long to wait before flushing makes a difference.

Quick Reference Summary

  • Windows 10 / 11: ipconfig /flushdns in elevated Command Prompt
  • Windows PowerShell: Clear-DnsClientCache
  • macOS Ventura through Sequoia: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • Linux with systemd-resolved: sudo resolvectl flush-caches
  • Linux with nscd: sudo systemctl restart nscd
  • Android: Toggle Airplane Mode or clear Chrome DNS cache at chrome://net-internals/#dns
  • iOS / iPadOS: Toggle Airplane Mode or reset network settings
  • Chrome / Edge browser: chrome://net-internals/#dns then Clear host cache
  • Firefox browser: about:networking#dns then Clear DNS Cache

A DNS flush takes seconds and costs nothing. When a site is showing the wrong content, refusing to connect, or looping to a dead IP, it is always worth clearing the cache before digging deeper into routing issues, CDN configuration, or server-side problems. Start with the flush, verify with a direct query to a public resolver, and you will eliminate the most common cause of post-migration connectivity headaches in under a minute.