DNS flush
Clearing the locally-cached DNS answers so the next query goes back out to the network. Useful for debugging when 'I just changed DNS but I'm still seeing the old value'.
A DNS flush clears your machine's local DNS cache. Next lookup goes to the network, picks up fresh records, and recaches.
You'd flush DNS when you've just changed a record and want to verify the change without waiting for the old TTL to expire on your machine.
How to flush per OS
macOS:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
Windows:
ipconfig /flushdns
Linux (systemd-resolved):
sudo resolvectl flush-caches
Linux (nscd):
sudo systemctl restart nscd
Browser-only flush (Chrome):
chrome://net-internals/#dns
Click "Clear host cache."
Why flushing only sometimes helps
You can flush YOUR machine. You can't flush your ISP's recursive resolver or anyone else's. If a customer is still seeing the old DNS value, their resolver may be caching it for the remainder of the TTL.
Two workarounds for customers stuck on stale DNS:
- Use a different resolver. Tell them to set DNS to 1.1.1.1 or 8.8.8.8 temporarily.
- Wait the TTL out.
In dev / staging
You don't usually need to flush during normal development; tools like dig bypass the OS cache and ask resolvers directly. Flush is mostly for testing changes from a browser's perspective.