How to Flush Your DNS Cache
Your computer keeps a local cache of DNS answers so it doesn't have to re-resolve every domain on every request. That's great for speed — until a site changes servers and your cache keeps pointing at the old address. The result is a site that loads for everyone else but not for you, or one that never seems to pick up a migration. Flushing the DNS cache wipes those stored answers and forces fresh lookups. It's safe, takes seconds, and is one of the highest-value fixes in network troubleshooting.
When flushing DNS actually helps
Flush your cache when a specific site won't load but works on other devices or networks, when you see DNS_PROBE_FINISHED_NXDOMAIN for a site you know exists, or when a site you migrated still resolves to the old server on your machine. Before flushing, you can confirm the diagnosis: run the domain through a DNS lookup and compare the answer to what your machine resolves. If the public answer differs from what your browser is reaching, stale cache is the likely culprit.
Windows
Open Command Prompt (or PowerShell) and run: ipconfig /flushdns. Windows confirms with "Successfully flushed the DNS Resolver Cache." This works identically on Windows 10 and 11 and doesn't need a restart. To see what was cached beforehand, ipconfig /displaydns lists every stored record.
macOS
Open Terminal and run: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. Enter your password when prompted (nothing appears as you type — that's normal). There's no confirmation message; the prompt just returns. This command works on all recent macOS versions.
Linux
Most modern distributions (Ubuntu 18.04+, Fedora, Debian 12) use systemd-resolved: run sudo resolvectl flush-caches. On older setups the command is sudo systemd-resolve --flush-caches. If your system runs dnsmasq or nscd instead, restart that service: sudo systemctl restart dnsmasq (or nscd). If none of these services exist, your distribution may not cache DNS at the OS level at all — the browser cache below is then the one that matters.
Don't forget the browser's own cache
Chrome and Edge keep an internal DNS cache separate from the operating system's. In Chrome, visit chrome://net-internals/#dns and click "Clear host cache" (edge://net-internals/#dns in Edge). Firefox honors the OS cache but holds resolutions per-session, so fully restarting the browser clears it. If a site still resolves wrong after an OS flush, this is almost always why.
Still resolving wrong? Look upstream
Your local cache is only the first link in the chain. Your router often runs its own DNS cache (reboot it), and your ISP's resolver caches answers for the duration of each record's TTL. If a recently changed domain still resolves to the old address after flushing everything local, check its worldwide propagation status — if other regions show the old value too, the change simply hasn't propagated yet and no amount of local flushing will hurry it.