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.
Windows 11 and 10
- Press Windows + R, type
cmd, press Enter. - Type
ipconfig /flushdnsand press Enter. - 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 version | Command |
|---|---|
| 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 Sierra | sudo killall -HUP mDNSResponder |
Linux
| Distribution / service | Command |
|---|---|
| Ubuntu 22.04+, Fedora, most systemd systems | sudo resolvectl flush-caches |
| Older systemd-resolved | sudo systemd-resolve --flush-caches |
| dnsmasq | sudo systemctl restart dnsmasq |
| nscd | sudo systemctl restart nscd |
| No local cache | Nothing 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.