DNS Troubleshooting
How to Flush the DNS Cache on Windows, macOS, and Linux
The exact commands to clear a stale local DNS cache on every major operating system, plus how to clear a browser's own separate cache.
3 OSes
Windows, macOS, and Linux each use a different flush command
Seconds
How long a local DNS flush actually takes to run
24/7
Human support for DNS troubleshooting beyond the local cache
Free
DNS management included with hosting
In short
To flush DNS cache: on Windows, run ipconfig /flushdns in Command Prompt; on macOS, run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in Terminal; on Linux systems using systemd-resolved, run sudo resolvectl flush-caches (or sudo systemd-resolve --flush-caches on older versions). Each command clears the operating system's locally cached DNS answers immediately.
A flushed OS cache doesn't clear a browser's separate internal DNS cache, so if a change still doesn't appear after flushing, checking the browser's own DNS cache (or simply restarting it) is the next step.
A device's operating system keeps its own local cache of recent DNS lookups, separate from every resolver further up the chain, purely to avoid re-querying the network for a hostname it just looked up moments ago. That local cache is exactly what makes a freshly changed DNS record still show the old value on one specific machine, even after global propagation has otherwise finished.
This guide gives the precise flush command for each major operating system, since the syntax differs meaningfully between them, plus the extra step of clearing a browser's own DNS cache when the OS-level flush alone doesn't seem to fix it.
Flushing DNS on Windows
Open Command Prompt (searching 'cmd' in the Start menu works, and it doesn't need to be run as administrator for this specific command) and run ipconfig /flushdns. Windows confirms with a message reading 'Successfully flushed the DNS Resolver Cache,' and the change takes effect immediately with no restart required.
This command clears every cached DNS entry Windows has stored locally, meaning the very next lookup for any hostname goes out fresh rather than reusing a stored answer. It's safe to run at any time and has no side effects beyond a very brief moment where the next few lookups take slightly longer since nothing is cached yet.
Flushing DNS on macOS
Open Terminal and run sudo dscacheutil -flushcache followed by sudo killall -HUP mDNSResponder, entering the admin password when prompted. Both commands are needed on modern macOS versions since dscacheutil clears the directory service cache while the mDNSResponder restart clears the process actually handling DNS resolution.
Older macOS versions sometimes used a slightly different single command, so if the two-command version above returns an error about an unrecognized process, checking the specific macOS version in use helps identify the correct legacy syntax, though the dscacheutil plus mDNSResponder combination covers all recent versions.
Flushing DNS on Linux
Most modern Linux distributions handle DNS resolution through systemd-resolved, in which case sudo resolvectl flush-caches clears the cache immediately (older systemd versions use sudo systemd-resolve --flush-caches instead, with a hyphen rather than the newer combined command name). Running resolvectl statistics afterward confirms the cache size has reset to zero.
Distributions not using systemd-resolved may instead run a local caching service like nscd or dnsmasq, in which case restarting that specific service (for example, sudo systemctl restart nscd) achieves the same result. Checking which resolver service is actually active with resolvectl status or a similar command clarifies which flush method applies.
Clearing a Browser's Own DNS Cache
Beyond the operating system, most browsers maintain a separate, shorter-lived DNS cache of their own for performance reasons. Chrome-based browsers expose this at chrome://net-internals/#dns, with a 'Clear host cache' button that empties it directly; Firefox handles this more automatically and typically clears its cache on a restart.
If flushing the OS-level DNS cache doesn't make a change visible, closing and reopening the browser entirely (rather than just the tab) resolves most remaining cases, since a full browser restart clears its internal cache along with the process itself. Testing in a private/incognito window is another fast way to rule out browser-level caching specifically, since private windows typically start without any cached DNS state.

Support When Flushing Alone Isn't the Full Fix
Flushing a local DNS cache solves what's happening on one device, but if a DNS record itself is misconfigured, no amount of local flushing will fix it — that's a change that has to happen at the authoritative record level instead.
Hosting Cheap's 24/7 human support helps tell the difference quickly, checking whether an issue is a local cache, a propagation delay, or an actual misconfigured record needing a real DNS fix.
- 24/7 human support to diagnose whether it's a cache issue or a real DNS problem
- Clear DNS panel to check and correct the authoritative record directly
- Free managed migration handled without leaving stale local caches behind
- Daily backups in place while diagnosing DNS or connectivity issues
Why Hosting Cheap
What you get
24/7 Human Support
Get help distinguishing a local cache issue from an actual DNS misconfiguration.
Clear DNS Record Panel
Check the authoritative record directly to confirm it's correct before blaming local caching.
Free Managed Migration
DNS changes during a move are made cleanly, reducing stale-cache confusion afterward.
Daily Backups
A safety net in place while troubleshooting connectivity or DNS-related issues.
Free Auto-Renewing SSL
Stays valid and unaffected by local DNS caching once traffic reaches the server.
Pure NVMe SSD + LiteSpeed
Fast responses the moment a flushed cache sends a fresh lookup through.
How It Works
Get set up in a few steps
Run the OS-specific flush command
Use ipconfig /flushdns on Windows, dscacheutil plus mDNSResponder on macOS, or resolvectl on Linux.
Restart the browser
Close and reopen the browser fully, or use a private window, to clear its separate internal DNS cache.
Confirm with a fresh lookup
Visit the site or run a DNS lookup tool afterward to verify the current, correct record is now showing.
Included
Everything you need, on every plan
- Correct OS-specific flush command identified and run (Windows, macOS, or Linux)
- Admin/sudo password entered where the command requires elevated permissions
- Browser fully restarted, not just the tab, after flushing the OS cache
- Private/incognito window tested to rule out browser-level caching
- Fresh DNS lookup tool used to confirm the correct record is now returned
- Authoritative record checked directly if flushing doesn't resolve the issue
FAQ
Frequently asked questions
Does flushing DNS delete my internet history?
No, flushing the DNS cache only clears stored hostname-to-IP lookups used for faster resolution. It has no connection to browser history, bookmarks, or any saved personal data.
Why doesn't ipconfig /flushdns fix everything?
It only clears the operating system's own cache — a browser's separate internal DNS cache, or a resolver further upstream at the ISP level, isn't affected by this local command. Restarting the browser or waiting out propagation covers those other layers.
Is it safe to flush DNS regularly?
Yes, flushing DNS has no negative side effects beyond a brief moment where the next few lookups take slightly longer since nothing is cached. It's a routine, safe troubleshooting step.
How do I flush DNS on an older version of macOS?
Some older versions used a single combined command rather than the two-step dscacheutil and mDNSResponder approach used today. Checking the specific macOS version helps identify the exact legacy syntax that applies.
What if resolvectl isn't recognized on my Linux system?
This usually means the distribution is running an older systemd version, in which case systemd-resolve --flush-caches (with a hyphen) is the equivalent command, or the system may be using a different resolver service like dnsmasq or nscd entirely.
Will flushing DNS fix a genuinely broken DNS record?
No, flushing only clears what's cached locally — if the actual authoritative record is wrong or missing, no amount of local flushing changes that. The record itself needs to be corrected at the DNS provider first.
Get Help When DNS Issues Go Beyond a Cache Flush
24/7 human support and a clear DNS panel help pinpoint whether it's local caching or a real record problem.
Get Started