How to Flush DNS Cache on Windows, Mac, Linux, and Browsers

Flushing your DNS cache clears stored domain-to-IP address mappings so your computer fetches fresh records immediately. You flush DNS using ipconfig /flushdns on Windows, dscacheutil on macOS, or resolvectl on Linux. The command resolves stale website redirects and connection errors after DNS changes.

Browser Resolver Root+TLD Authoritative Website query solid = query · dashed = cached response · every hop caches until TTL
The DNS resolution path: local computers cache records before querying external resolvers

Quick Reference: Commands to Flush DNS Cache by Operating System

Every operating system and web browser provides a built-in command or internal diagnostic page that wipes cached DNS records in seconds. The table below lists the exact DNS flush command and confirmation output for Windows, macOS, Linux, and web browsers.

Operating System / BrowserExact Flush Command or URLConfirmation Output
Windows 11 / 10 / Server (CMD)ipconfig /flushdnsSuccessfully flushed the DNS Resolver Cache.
Windows 11 / 10 (PowerShell)Clear-DnsClientCacheSilent success (no error output).
macOS (Big Sur 11 to Sequoia 15+)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderPassword prompt; returns silently.
Linux (Ubuntu 22.04+ / systemd)sudo resolvectl flush-cachesSilent success (verify via resolvectl statistics).
Linux (Older systemd / Ubuntu 20.04)sudo systemd-resolve --flush-cachesSilent success.
Chrome / Edge / Brave / Operachrome://net-internals/#dns → Clear host cacheClears in-memory hostname table immediately.
Mozilla Firefoxabout:networking#dns → Clear DNS CacheClears Firefox internal DNS table.

Operating system caches and web browser caches operate as separate memory tables. Clearing the OS cache in Terminal while keeping Chrome or Firefox open allows browsers to serve previous IPs from their private memory until you clear the browser host cache or restart the application, as detailed in How DNS Works.

How to Flush DNS Cache on Windows 11, Windows 10, and Windows Server

To flush the DNS cache on Windows 11, Windows 10, or Windows Server, run the ipconfig /flushdns command inside Command Prompt or the Clear-DnsClientCache cmdlet in PowerShell across 3 quick steps.

Windows maintains an internal DNS resolver cache managed by the Windows DNS Client service. Clear this cache using the following sequence:

  1. Open the Start Menu, type cmd or powershell, and select Run as administrator.
  2. Execute the flush command inside the terminal window and press Enter:
    ipconfig /flushdns

    PowerShell users can alternatively run Clear-DnsClientCache to execute the identical memory reset without extra flags.

  3. Confirm that Windows displays Successfully flushed the DNS Resolver Cache.

Users can also launch the command directly through the Windows Key + R Run dialog shortcut (Win + R, type ipconfig /flushdns, and press Enter), and resolve stubborn network binding conflicts by combining the flush with ipconfig /release and ipconfig /renew.

How Do You View Cached DNS Records on Windows Before Flushing?

You inspect all currently stored DNS records and their remaining Time to Live (TTL) timers on Windows by running ipconfig /displaydns in Command Prompt.

Running ipconfig /displaydns | more (or Get-DnsClientCache in PowerShell) lists cached hostnames, record types, and remaining Time to Live (TTL) seconds. The error Could not flush the DNS Resolver Cache: Function failed during execution appears if the DNS Client (dnscache) service is stopped; starting it in services.msc fixes this.

How to Flush DNS Cache on macOS (Sequoia, Sonoma, Ventura, Monterey, and Older OS X)

To flush the DNS cache on modern macOS (Big Sur 11 through Sequoia 15 and Tahoe), run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder inside the macOS Terminal app in 3 steps.

Execute the reset through the following sequence:

  1. Launch the Terminal application by pressing Command + Space to summon Spotlight Search, typing Terminal, and pressing Return.
  2. Paste the unified directory-service and responder reset command into Terminal and press Return:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  3. Enter your Mac administrator account password when prompted and press Return. Password characters remain hidden on screen during entry; a clean prompt indicates successful cache purging.

The table below lists the exact terminal flush command for every macOS and legacy OS X release.

macOS / OS X VersionVersion NumbersTerminal Flush Command
Yosemite (10.10.4) to Sequoia 15+10.10.4 to 15+sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
OS X Yosemite (Early)10.10.1 to 10.10.3sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches
OS X Mavericks to Lion10.7 to 10.9sudo killall -HUP mDNSResponder
Mac OS X Snow Leopard10.6sudo dscacheutil -flushcache

Modern macOS requires two utilities: dscacheutil -flushcache clears Directory Service lookups, while killall -HUP mDNSResponder delivers a hangup signal (SIGHUP) to Apple's native mDNSResponder daemon to reload tables without dropping network links.

How to Flush DNS Cache on Linux (Ubuntu, Debian, Fedora, RHEL, and Arch)

To flush the DNS cache on Linux, run the flush command matching your distribution's active DNS resolver service (systemd-resolved, nscd, dnsmasq, or BIND).

Linux distributions deploy distinct local stub resolver daemons. Identify and clear your active resolver using these 4 targeted methods:

  1. Ubuntu 22.04+, Debian 12+, and Fedora (systemd-resolved via resolvectl):
    sudo resolvectl flush-caches
    sudo resolvectl statistics

    The statistics command confirms cache clearing by displaying Current Cache Size: 0 under the cache section.

  2. Older Ubuntu Releases (18.04 / 20.04) and Legacy systemd:
    sudo systemd-resolve --flush-caches
  3. Systems Running dnsmasq (Lightweight Forwarding Daemon):
    sudo systemctl restart dnsmasq
  4. Systems Running nscd or Local BIND (named):
    sudo systemctl restart nscd
    sudo rndc flush

Minimal Linux servers without local caching daemons query nameservers in /etc/resolv.conf directly with zero OS-level caching.

How to Clear the Internal DNS Cache in Chrome, Edge, Brave, Firefox, and Safari

To clear a web browser's internal DNS cache without restarting your computer, use the browser's built-in network internals diagnostic page to purge both the host cache and active socket pools.

Modern web browsers store DNS records independently from the operating system to accelerate page loading. Clear browser caches across the 3 primary rendering engines:

  1. Google Chrome, Microsoft Edge, Brave, and Opera (Chromium Engine):

    Navigate to chrome://net-internals/#dns (or edge://net-internals/#dns / brave://net-internals/#dns) in your address bar and click Clear host cache.

    Next, open chrome://net-internals/#sockets in the sidebar and click Flush socket pools. This step forces Chromium to close idle HTTP/2 and HTTP/3 socket pools and establish a fresh connection to the updated IP address.

  2. Mozilla Firefox:

    Type about:networking#dns into the address bar, press Enter, and click Clear DNS Cache to wipe its internal resolution table immediately.

  3. Apple Safari (macOS):

    Safari delegates DNS caching to macOS. Closing Safari completely (Command + Q) after running the Terminal flush command ensures fresh lookups, or select Develop → Empty Caches (Option + Command + E).

Purging application-level host caches alongside open socket pools ensures that browser networking threads immediately initiate fresh lookups against system resolver interfaces.

How to Flush DNS Cache on iPhone (iOS), Android, and Home Wi-Fi Routers

You clear cached DNS records on smartphones and local networks using 3 device-specific reset actions across iOS, Android, and your local Wi-Fi router.

Mobile devices and local network hardware maintain independent resolution caches:

  1. iPhone and iPad (iOS / iPadOS): Toggle Airplane Mode ON in Control Center, wait 10 seconds, and toggle Airplane Mode OFF to reset wireless interfaces and flush the iOS mDNSResponder cache immediately.
  2. Android Smartphones and Tablets: Toggle Airplane Mode ON for 10 seconds and OFF to clear the radio cache, and open chrome://net-internals/#dns inside Chrome for Android to tap Clear host cache.
  3. Home and Office Wi-Fi Routers (CPE Forwarder Cache): Wi-Fi routers act as local caching DNS forwarders (typically at 192.168.1.1 or 192.168.0.1). Disconnect the router power adapter, wait 30 seconds, and plug it back in to wipe the router RAM cache completely.

Power cycling local wireless equipment and toggling cellular network interfaces purges stubborn gateway forwarder tables that retain obsolete IP records across connected client devices.

Why Should You Flush Your DNS Cache? (4 Common Scenarios and What to Do If It Fails)

Administrators and everyday users flush their local DNS cache to resolve 4 common networking issues: post-migration stale IPs, browser resolution errors, DNS spoofing recovery, and local search privacy.

Flushing your local cache resolves disruptions across these 4 circumstances:

  1. Seeing the Old Server After a Website Migration or DNS Edit: Your local operating system or browser continues serving old A or AAAA records until the local TTL expires.
  2. Fixing DNS_PROBE_FINISHED_NXDOMAIN and ERR_NAME_NOT_RESOLVED Errors: Accessing newly registered domains before global publication causes local resolvers to cache negative responses. Diagnostic steps are detailed in Website Not Resolving? and Site Down After a DNS Change?.
  3. Recovering From Local DNS Cache Poisoning or Hosts File Tampering: Clearing local tables purges forged address mappings inserted by attackers, preserving security as covered in DNS Cache Poisoning and DNS-over-HTTPS vs DNS-over-TLS.
  4. Clearing Local Browsing Footprint on Shared Computers: Any administrative user can run ipconfig /displaydns to inspect recently visited domains unless the cache is cleared.

When no resolver on the path answers at all, the fault sits with the resolver rather than the cache: the DNS Server Not Responding guide walks that case.

The outdated DNS record resides upstream at your Internet Service Provider's recursive resolver when clearing your local cache, purging browser socket pools, and rebooting your router still returns the previous IP address. Administrators can inspect global resolver status with the DNS Propagation Checker and verify remaining cache expiration timers via the DNS TTL Checker. Reconfiguring your network adapter to query public resolvers such as Cloudflare (1.1.1.1) or Google Public DNS (8.8.8.8) bypasses sluggish ISP caches while global DNS Propagation completes; compare live latency and jitter from your connection first in the DNS speed test. Public cache-flush portals such as Google Public DNS also require flushing the apex root domain prior to clearing individual subdomains whenever nameserver delegations change, ensuring validating resolvers purge parent delegation records before refreshing child records.

Frequently asked questions

Is it safe to flush my DNS cache?+

Yes, flushing your DNS cache is completely safe and never deletes personal files, saved passwords, browser cookies, or active logins. It only clears temporary domain-to-IP address lookups stored in memory.

Will flushing DNS disconnect my internet or slow down my computer?+

No, flushing DNS does not drop your Wi-Fi or Ethernet connection. The very first visit to each website after a flush takes an extra 20 to 100 milliseconds while your computer fetches a fresh IP address, then returns to normal cached speed.

Why does ipconfig /flushdns say "The requested operation requires elevation"?+

Windows requires Administrator privileges to clear the system-wide DNS Client cache on some configurations. Right-click Command Prompt or PowerShell in the Start Menu and select Run as administrator before running ipconfig /flushdns. In practice, administrators frequently bypass terminal elevation by toggling Airplane mode on and off, which reinitializes Windows network adapters and purges cached lookups automatically.

Why am I still seeing the old website after flushing my DNS cache?+

Your ISP's upstream recursive DNS server still holds the old record in its cache until the previous TTL timer expires. Check live global status in the DNS Propagation Checker, or switch your device DNS to 1.1.1.1 or 8.8.8.8 to bypass your ISP cache. In production troubleshooting, we recommend testing domain lookups using an incognito browser window and verifying resolution via dig or nslookup against external recursive resolvers.

Last verified: 2026-11-28