How to Flush DNS Cache on Windows, Mac, Linux, Chrome & Phones

Every device keeps a small memory of recent DNS lookups so that returning to a site does not need another round trip. Most of the time that cache is invisible and helpful. When a site has just moved, when you have changed DNS servers, or when a lookup failed and the failure got remembered, it is the reason a site will not load. Flushing it takes one command. Here is the exact command on every platform, and what to try when flushing is not enough.

What the DNS cache is

When you visit a site, your device asks a resolver for its IP address and keeps the answer for the time the record’s owner specified, its time-to-live. A typical TTL is between five minutes and a day. Until it expires, your device reuses the stored answer without asking again. Browsers keep a second, shorter cache of their own, the router keeps a third, and your provider’s resolver keeps a fourth. Cloudflare’s documentation on TTL explains how site owners choose the value.

Up to 24 his how long a stale answer can survive at a common TTL of 86,400 seconds, which is why a site that just changed hosts can work for some people and fail for others for most of a day.Source: Cloudflare DNS documentation

Windows 11 and 10

  1. Press Windows + R, type cmd, press Enter.
  2. Type ipconfig /flushdns and press Enter.
  3. You will see Successfully flushed the DNS Resolver Cache.

To see what was cached first, run ipconfig /displaydns. If a site still fails, also run ipconfig /release and ipconfig /renew to pick up fresh network settings from the router.

macOS

Open Terminal from Applications → Utilities, paste the line for your version and press Enter. You will be asked for your password; nothing appears as you type it.

macOS versionCommand
Sonoma, Sequoia and later (14+)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Big Sur through Ventura (11–13)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Catalina and Mojave (10.14–10.15)sudo killall -HUP mDNSResponder
El Capitan through High Sierrasudo killall -HUP mDNSResponder

Linux

Distribution / serviceCommand
Ubuntu 22.04+, Fedora, most systemd systemssudo resolvectl flush-caches
Older systemd-resolvedsudo systemd-resolve --flush-caches
dnsmasqsudo systemctl restart dnsmasq
nscdsudo systemctl restart nscd
No local cacheNothing to flush; the resolver in /etc/resolv.conf is asked every time

Chrome, Edge, Brave and other Chromium browsers

Browsers cache separately from the operating system. In the address bar, open chrome://net-internals/#dns (or edge://net-internals/#dns, brave://net-internals/#dns) and click Clear host cache. Then open chrome://net-internals/#sockets and click Flush socket pools so that open connections to the old address are closed too.

Firefox

Type about:networking#dns in the address bar and click Clear DNS Cache. If you use Firefox’s DNS over HTTPS, the answers come from the provider you chose there rather than the operating system; Mozilla explains the setting at support.mozilla.org.

Safari

Safari uses the macOS system cache, so the Terminal command above clears it. Enable the Develop menu in Safari settings and choose Develop → Empty Caches to clear the browser’s own copy.

Android

There is no exposed command. Toggle Airplane Mode on, wait ten seconds, and turn it off, which resets the network stack and its cache. In Chrome for Android, chrome://net-internals/#dns works too. Forgetting and rejoining the Wi-Fi network clears any cached settings from the router.

iPhone and iPad

Toggle Airplane Mode on for ten seconds and back off. If a site still resolves to an old address, restart the device, or go to Settings → General → Transfer or Reset → Reset Network Settings, which also clears saved Wi-Fi networks.

Your router

Most home routers run a forwarding resolver with its own cache. A restart clears it. Some, including AVM FRITZ!Box and MikroTik, expose a flush button in the DNS settings. Log in at your router’s address to check.

When flushing does not fix it

A stale answer may live at your provider’s resolver, which you cannot flush. Switch the device to a public resolver such as Cloudflare 1.1.1.1 or Google 8.8.8.8; our DNS servers comparison lists the addresses. If you run the site yourself and changed its records recently, the old answer will keep appearing for other people until the TTL expires; lowering the TTL a day before a planned change shortens the window next time. And if the error you see is DNS_PROBE_FINISHED_NXDOMAIN, the dedicated fix guide walks through the remaining causes.

Frequently asked questions

Is it safe to flush the DNS cache?
Completely. It only discards temporary lookup results. The next visit to each site performs a fresh lookup, which takes a few milliseconds longer than usual, and nothing else changes.
How often should I flush DNS?
Only when something is wrong: a site will not load, you have just changed a domain’s records, or you have switched DNS servers. There is no benefit to doing it on a schedule.
Does flushing DNS clear browsing history?
No. It clears the mapping of names to addresses, not your history, cookies or saved passwords.
Why does the site still not load after flushing?
Because the stale answer may live elsewhere: in the browser’s own cache, in the router, or at your provider’s resolver. Clear the browser cache, restart the router, and switch to a public resolver such as 1.1.1.1.
Does ipconfig /flushdns need administrator rights?
On current Windows versions it works in a normal Command Prompt. If it reports that the action requires elevation, right-click Command Prompt and choose Run as administrator.
Scroll to Top