How to clear the DNS cache on Windows, Mac, Linux and Chrome
TL;DR: Clearing the DNS cache makes your computer forget saved domain-to-IP answers, so it asks again. On Windows run ipconfig /flushdns. On macOS run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder. On Linux with systemd-resolved run resolvectl flush-caches. In Chrome open chrome://net-internals/#dns and click Clear host cache. If the site still shows the old address, the new DNS may not have propagated yet or your resolver still holds the old record.
When to clear the DNS cache
- You changed nameservers or an A record and still see the old site.
- A site works on your phone but not on your computer.
- You see a "server not found" error after a migration.
- You changed email DNS and tests still fail.
Clearing it only affects your own device. It cannot speed up DNS changes worldwide. Read how long DNS propagation takes.
Windows
Open Command Prompt as administrator:
ipconfig /flushdns
You should see "Successfully flushed the DNS Resolver Cache". To view the cache first, run ipconfig /displaydns.
macOS
Open Terminal:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
This works on recent macOS versions. Enter your password when asked.
Linux
Commands depend on the resolver:
# systemd-resolved
resolvectl flush-caches
# older systemd
sudo systemd-resolve --flush-caches
# nscd
sudo systemctl restart nscd
# dnsmasq
sudo systemctl restart dnsmasq
Chrome and other browsers
Chrome keeps its own host cache. Open chrome://net-internals/#dns and click Clear host cache. Also close and reopen the browser, or test in a private window. Firefox and Edge have similar internal caches that restart with the browser.
If it still does not update
- Check the live record with dig or nslookup.
- Compare against a public resolver such as 1.1.1.1 or 8.8.8.8.
- Check the TTL, since your resolver may keep the old answer until it expires.
- Restart the router, which can cache DNS.
- Confirm the change is saved at your DNS host.
FAQs
What does flushing the DNS cache do?
It deletes saved domain lookups on your device, forcing fresh queries.
Is it safe to clear the DNS cache?
Yes. The cache rebuilds automatically.
Will clearing DNS speed up propagation?
No. It only affects your own computer.
How do I clear the DNS cache on Android or iPhone?
Toggle airplane mode or restart the device. For Chrome on Android use the same net-internals page where available.
How do I clear the DNS cache on a router?
Restart the router.
Do I need admin rights?
On Windows and macOS you generally do for the system cache.
Why does my site still show the old IP?
The record may not have propagated, or a resolver is serving the old answer until the TTL expires.
How often should I flush DNS?
Only when you have a problem or after DNS changes.
Conclusion
Flush the DNS cache with the command for your system, clear Chrome's host cache and restart your browser. If the old address remains, check the live record and the TTL, because the problem is probably upstream.
HostCloud helps Indian websites with reliable hosting, domains and support. See the options at https://hostcloud.in.
Sources: