Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Flush the DNS Cache on Windows, macOS, and Linux

Clear cached DNS lookups on your operating system, then check why an old result may persist in the browser or upstream resolver.

Table of Contents

Flushing DNS clears cached name lookups on your device. Try it if a site recently moved to a new IP address or your computer still remembers a failed lookup. If the browser already reaches a server and gets a 404 or 502 response, start with the URL or server problem instead.

What is Flush DNS? How to Clear DNS Cache on Windows, Linux, MacOS Picture 1

Windows 10 or 11

Open Command Prompt or Windows Terminal and run:

ipconfig /flushdns

If Windows requires elevation, reopen the terminal as an administrator. Look for confirmation that the DNS Resolver Cache was flushed. See the Microsoft command reference.

macOS

Open Terminal in Applications > Utilities and run these commands on a recent release:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Enter your administrator password if prompted. Terminal may show no output. See the Mac DNS cache guide for more context.

Linux

Linux distributions use different resolvers. If resolvectl status shows an active systemd-resolved setup, run:

sudo resolvectl flush-caches

This clears the cache maintained by systemd-resolved. If your system uses something else, check which resolver or caching service is running before choosing a command. Some setups don’t maintain a local DNS cache. See the resolvectl manual.

If the old answer persists

Retry the same hostname. Compare the result on another device or use a resolver lookup to test DNS separately. A browser using its own secure DNS resolver, a router, or an upstream DNS server can still have its own cached result. Flushing your computer does not clear those caches, and an upstream answer can persist until its time to live expires.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.