Your operating system caches DNS query results locally to speed up repeated lookups. This is normally helpful, but it can cause you to see outdated website addresses after a DNS change has propagated. Flushing the DNS cache clears these stored entries and forces your device to fetch fresh records from a resolver.
Why Flushing DNS Cache Helps
When you visit a website, your OS checks its local DNS cache first. If it finds a cached answer, it uses that IP address directly without querying a resolver. This means you can continue reaching an old server even after the domain's DNS records have been updated and propagated globally — simply because your device has the old IP address saved.
Common situations where flushing the DNS cache resolves the problem include:
- A website has moved to a new server but your browser still loads the old one.
- You recently changed your domain's DNS records and want to test the new values.
- A DNS record was deleted or changed and you receive connection errors for a domain that should now resolve correctly.
- You changed your local
hostsfile and the change is not taking effect.
Flushing your local DNS cache only affects your device. Your ISP's resolver and public resolvers like 8.8.8.8 maintain their own independent caches. Even after flushing locally, your queries are still subject to the upstream resolver's cached TTL.
How to Flush DNS Cache on Windows 10 and Windows 11
Windows uses a built-in DNS client service that caches resolver responses. Theipconfig /flushdns command clears this cache immediately.
- Press Win + S and type Command Prompt.
- Right-click Command Prompt and choose Run as administrator.
- Type the following command and press Enter:
ipconfig /flushdnsYou should see the message: Successfully flushed the DNS Resolver Cache.
To also view the current DNS cache contents before flushing (useful for diagnosis), run:
# Display cached DNS entries
ipconfig /displaydns
# Then flush them
ipconfig /flushdns
# Confirm the cache is empty
ipconfig /displaydnsOn Windows 8 and later you can also flush the DNS cache from PowerShell (run as Administrator) with: Clear-DnsClientCache. This is equivalent to ipconfig /flushdns.
How to Flush DNS Cache on macOS
The command varies slightly depending on your macOS version, but the most reliable approach that works across Monterey, Ventura, and Sonoma is to use bothdscacheutil and restart the mDNSResponder daemon.
- Open Terminal (Applications → Utilities → Terminal).
- Run the following command (you will be prompted for your password):
# macOS Monterey, Ventura, and Sonoma
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderThere is no confirmation message on macOS. If the command completes without an error, the cache has been flushed.
| macOS Version | Command |
|---|---|
| Sonoma (14) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| Ventura (13) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| Monterey (12) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| Big Sur (11) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
| Catalina (10.15) | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder |
How to Flush DNS Cache on Linux
Linux DNS caching depends on which resolver service your distribution runs. Most modern Ubuntu, Debian, and RHEL-based systems use systemd-resolved. Older systems or those with custom configurations may use nscd or dnsmasq.
Ubuntu 18.04+, Debian 10+, RHEL/CentOS 8+ (systemd-resolved):
# Restart systemd-resolved to flush its cache
sudo systemctl restart systemd-resolved
# Check statistics and cache size before and after
systemd-resolve --statisticsSystems using nscd (Name Service Cache Daemon):
# Restart nscd to flush cache
sudo systemctl restart nscd
# Or invalidate just the hosts cache without a full restart
sudo nscd --invalidate=hostsSystems using dnsmasq (common on some desktop distributions):
sudo systemctl restart dnsmasqIf you are unsure which service is running on your system, check with:
# Check for systemd-resolved
systemctl is-active systemd-resolved
# Check for nscd
systemctl is-active nscd
# Check for dnsmasq
systemctl is-active dnsmasqHow to Flush DNS Cache in Chrome Browser
Chrome maintains its own internal DNS cache that is separate from the operating system cache. This can cause Chrome to use stale DNS records even after you flush the OS cache.
- Open a new tab in Chrome.
- Navigate to
chrome://net-internals/#dnsin the address bar. - Click the Clear host cache button to flush Chrome's DNS cache.
- Optionally, go to
chrome://net-internals/#socketsand click Flush socket pools to close any persistent connections to old servers.
For a thorough reset after a DNS change, flush the OS DNS cache first, then flush Chrome's internal cache, and finally close and reopen the browser. This ensures no stale data is served from any layer of the caching stack.
Verifying the Flush Worked
After flushing, verify that your device now resolves the domain to the correct new address using nslookup or dig:
# Quick check — shows the resolved IP address
nslookup example.com
# More detail — shows TTL and full answer section
dig example.com A
# Compare against a known-good public resolver to confirm they match
dig example.com A @8.8.8.8If nslookup or dig returns the new IP address but your browser still loads the old site, the browser itself has a connection cache. Close all browser tabs for the domain and reopen, or use a private/incognito window for a completely clean test.
You can also use the ShowDNS DNS Lookup tool to check what a public resolver returns for your domain, confirming whether the issue is local to your device or upstream.
When Flushing DNS Cache Does Not Help
If flushing the DNS cache does not resolve the issue, the problem may be:
- Upstream resolver cache: Your ISP's resolver may still have the old record. Switch temporarily to a public resolver (8.8.8.8 or 1.1.1.1) in your network settings to bypass this.
- DNS propagation not yet complete: The record may not have reached all resolvers yet. Use the DNS Propagation Checker to see global status.
- Incorrect DNS change: The authoritative nameserver may still serve the old value if the change was not saved correctly. Verify with
dig example.com A +trace.
Frequently Asked Questions
Is it safe to flush the DNS cache?
Yes. Flushing the DNS cache is a non-destructive operation. It simply removes cached lookups, forcing your device to perform fresh DNS queries. The only side effect is a brief increase in DNS query time as the cache is rebuilt — typically imperceptible to the user.
How often should I flush my DNS cache?
Only flush the DNS cache when you have a specific reason to, such as after a DNS change, when troubleshooting connectivity to a domain, or when a website appears to be loading from an old server. Routine flushing provides no benefit.
Why does the website still show the old version after flushing?
There are several possible reasons: your ISP's resolver still has the old record cached, DNS propagation is not yet complete globally, or your browser has cached the page content itself (separate from DNS). Try opening the site in a private window and using a public DNS resolver temporarily (8.8.8.8 or 1.1.1.1) in your network settings.
Does flushing DNS cache improve internet speed?
No. Flushing the cache slightly increases DNS lookup time briefly because fresh queries must be made for every domain. The DNS cache exists specifically to speed up browsing. Flushing it is a troubleshooting step, not a performance optimization.
How do I flush DNS cache on a Chromebook?
Chrome OS uses Chrome's internal DNS resolver. Navigate to chrome://net-internals/#dns and click Clear host cache. You can also restart the device, which clears the DNS cache as part of the boot process.