ipconfig /flushdns on Windows, sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder on macOS, or sudo resolvectl flush-caches on most Linux systems. Then clear the browser’s own DNS cache (chrome://net-internals/#dns in Chrome and Edge) and its cached files. Restart the browser and try the site again, ideally in a private window.When to flush DNS and clear the cache
- A website moved to a new server, and you still see the old one.
- DNS records were changed, but your computer still uses the old address.
- A site shows old images, styles or pages after an update.
- You get “site can’t be reached” errors for a site that works for others.
There are two separate caches. The DNS cache remembers which IP address a domain points to. The browser cache keeps copies of files such as images and stylesheets. A moved site usually needs the DNS cache cleared; a site that looks outdated usually needs the browser cache cleared.
Flush DNS on Windows 10 and 11
- Press Win + S, type Command Prompt, and choose Run as administrator.
- Run the command below. Windows confirms with “Successfully flushed the DNS Resolver Cache”.
ipconfig /flushdns
:: Optional: show what is cached now
ipconfig /displaydns
Flush DNS on macOS
Open Terminal and run the command below. It asks for your Mac password and prints nothing when it works.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Flush DNS on Linux
# Most current distributions (systemd-resolved)
sudo resolvectl flush-caches
resolvectl statistics # "Current Cache Size" should be 0
# If you use nscd or dnsmasq instead
sudo systemctl restart nscd # or: sudo systemctl restart dnsmasq
Clear the browser’s DNS cache
| Browser | How |
|---|---|
| Chrome | Open chrome://net-internals/#dns and click Clear host cache. Then open chrome://net-internals/#sockets and click Flush socket pools. |
| Edge | Open edge://net-internals/#dns and click Clear host cache. |
| Firefox | Open about:networking#dns and click Clear DNS Cache. |
| Safari | Safari uses the macOS cache; flush it as shown above. |
Clear cached files in the browser
Chrome and Edge
- Press Ctrl + Shift + Delete (Cmd + Shift + Delete on a Mac).
- Choose a time range, tick Cached images and files, and click Clear data.
Firefox
- Press Ctrl + Shift + Delete.
- Tick Temporary cached files and pages and click Clear.
Safari
- Open Safari > Settings > Advanced and turn on Show features for web developers.
- Choose Develop > Empty Caches.
Clearing cookies as well logs you out of websites, so only clear them if a login or session problem needs it. For a single page, a hard reload often helps: Ctrl + F5 on Windows, Cmd + Shift + R on a Mac.
Check which address your computer uses
nslookup example.com # asks your DNS server
ping example.com # uses your computer's cache and hosts file
If the two show different addresses, something on your computer, such as an old cache entry or a line in the hosts file, overrides DNS. Our hosts file guide shows how to check it.
Flush DNS on a phone
- Android: turn flight mode on and off, or restart the phone. In Chrome, clear cached images and files under Settings > Privacy and security.
- iPhone and iPad: turn flight mode on and off, or restart the device. For Safari’s files, go to Settings > Apps > Safari > Clear History and Website Data.
Still seeing the old site?
- Your router or internet provider may cache DNS too. Restarting the router clears its cache.
- The DNS change may not have reached all resolvers yet. Wait for the record’s TTL to pass.
- A CDN or website cache may serve old pages. Purge the cache in the CDN or the site’s caching plugin.
Need help with this?
Moving your site to UnderHost? Our support team can help you plan the DNS switch.
Frequently asked questions
How do I flush DNS on Windows 11?
Open Command Prompt as administrator and run ipconfig /flushdns.
Does clearing the browser cache flush DNS?
No. The browser has its own short DNS cache, cleared on its net-internals page, separate from cached files and the system DNS cache.
Will flushing DNS delete my passwords or history?
No. It only clears remembered domain addresses. Clearing browsing data can remove cookies and history if you tick those options.
Why do I still see the old website after flushing?
Your router, your internet provider or a CDN may still cache it, or DNS has not finished updating.
Is it safe to flush DNS?
Yes. The cache is rebuilt automatically as you browse.
Related guides
