Complete Guide to Flushing DNS Cache on Windows 11/10, macOS, and Linux
When a website updates its hosting server, migrates to a new IP address, or recovers from a major outage, you might find that your computer still refuses to load the page while your phone on cellular data opens it immediately.
The primary culprit behind this discrepancy is stale local DNS caching.
To speed up everyday web browsing, operating systems and modern web browsers save recent domain name lookups in a temporary database called the DNS Resolver Cache. However, when an IP address changes or a temporary outage record is saved, your system continues trying to connect to the obsolete server until the cache expires.
Flushing the DNS cache purges all cached lookup tables and forces your device to request fresh, authoritative records directly from the internet. This complete tutorial covers how to flush DNS across Windows, macOS, Linux, and web browsers.
When Should You Flush Your DNS Cache?
Flushing your DNS resolver cache is an essential troubleshooting step when:
- A website recently recovered from downtime: If XP Down Detector shows a service has returned to "Normal" status, but your browser still displays a connection timeout or 502/503 error, your local cache is likely retaining the stale outage state.
- You modified domain DNS records: If you updated
A,CNAME, orMXrecords for your own domain and want to inspect the changes immediately. - Resolving
DNS_PROBE_FINISHED_NXDOMAINorERR_NAME_NOT_RESOLVED: These browser errors directly signify that your local resolver believes the domain name does not exist. - Clearing DNS Poisoning / Spoofing: If you suspect malware or a rogue public Wi-Fi network altered your local DNS lookup tables.
How to Flush DNS on Windows 11 and Windows 10
Windows makes it simple to clear the DNS cache using the command prompt:
- Press the
Windows Keyand typecmd. - Right-click on Command Prompt and select Run as Administrator (or press
Ctrl + Shift + Enter). - In the command prompt window, type the following command and press
Enter:ipconfig /flushdns - Within a second, Windows will display the confirmation output:
Windows IP Configuration Successfully flushed the DNS Resolver Cache. - (Optional) To view remaining cached DNS entries in Windows, run:
ipconfig /displaydns
How to Flush DNS on macOS (Sonoma, Ventura, Monterey, and Older)
Because Apple uses different internal DNS daemons (mDNSResponder and dscacheutil) across macOS versions, the terminal command combines both flushing and restarting the responder process.
- Press
Cmd + Spaceto open Spotlight, typeTerminal, and pressEnter. - Copy and paste the command corresponding to your macOS version:
For macOS Sonoma, Ventura, Monterey, and Big Sur:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
- Press
Enterand type your macOS administrator password (keystrokes will remain invisible for security). - macOS will not print a success confirmation, but returning to a blank prompt indicates the cache has been cleared and the DNS responder daemon has restarted with fresh lookup tables.
How to Flush DNS on Linux (Ubuntu, Debian, Fedora, Arch)
Unlike Windows and macOS, not all Linux distributions run a local DNS cache by default. However, most modern distributions running systemd use systemd-resolved or dnsmasq.
For distributions using systemd-resolved (Ubuntu 20.04+, Debian, Fedora):
- Open a terminal window and run:
(On older systemd versions, use:sudo resolvectl flush-cachessudo systemd-resolve --flush-caches) - To verify the cache statistics and size, execute:
You should seeresolvectl statisticsCurrent Cache Size: 0.
For distributions using dnsmasq:
sudo systemctl restart dnsmasq
Flushing DNS Cache Inside Web Browsers
Modern Chromium-based web browsers (Google Chrome, Microsoft Edge, Brave, Opera) maintain a secondary, internal DNS cache independent of your operating system. If flushing your OS cache does not resolve the issue, clear the browser's internal host cache:
In Google Chrome:
- Open a new tab and paste this into the address bar:
chrome://net-internals/#dns - Click the Clear host cache button.
- Paste this into the address bar to clear active socket pools:
chrome://net-internals/#sockets - Click Flush socket pools.
In Microsoft Edge:
- Navigate to:
edge://net-internals/#dns - Click Clear host cache.
Summary Checklist
- Flush the OS DNS cache (
ipconfig /flushdnson Windows,killall -HUP mDNSResponderon Mac). - Clear internal browser host cache via
chrome://net-internals/#dns. - Restart your browser.
- Verify whether the service is genuinely operational by checking the live status on XP Down Detector or running our Speed Test tool.
Experiencing an outage right now? Check the latest status directly from our live dashboard:
⚡ Open Realtime Status Dashboard