Playbook
How to Clear Your DNS Cache
When a DNS change works for everyone except you, an old answer is usually sitting in a cache between you and the authoritative servers. This guide shows how to clear each cache you control, how to check that it worked, and why a flush cannot fix a record that is wrong at the source.
The short answer
Your device, your browser, your router and your recursive resolver can each hold a DNS answer until its TTL runs out. First ask the domain's authoritative nameservers what the record is now. If they already give the new answer, clear the caches nearest to you: the browser, then the operating system, then the router. If the authoritative answer is still old or wrong, no amount of flushing helps; fix the record at your DNS provider. Caches you do not control, such as your ISP's resolver, clear on their own when the TTL expires.
Step 1: check the source first
Before clearing anything, compare three answers for the same name. Replace ns1.example.com with one of the domain's real nameservers, which the first command lists.
| Command | Which layer answers |
|---|---|
| dig +short example.com NS | The domain's nameservers, to use in the next command |
| dig +norecurse @ns1.example.com www.example.com A | The authoritative server: the truth, with no cache in the way |
| dig www.example.com A | Your configured recursive resolver, with the TTL it has left |
| Resolve-DnsName www.example.com -Server ns1.example.com -DnsOnly | The authoritative answer from Windows PowerShell |
| Resolve-DnsName www.example.com | What Windows itself returns, including its cache and the hosts file |
| dscacheutil -q host -a name www.example.com | What macOS itself returns |
| getent hosts www.example.com | What Linux applications get, including /etc/hosts |
If the authoritative answer is new and your resolver's is old, the resolver will catch up within the TTL it shows. If the resolver is new but your computer is old, clear the operating system and browser caches below.
Step 2: clear the operating system cache
| System | Command or action | Notes |
|---|---|---|
| Windows 10 and 11 | ipconfig /flushdns | From Command Prompt or PowerShell. Run it as administrator if it reports that access is denied. |
| Windows PowerShell | Clear-DnsClientCache | The same flush. Get-DnsClientCache lists what is cached. |
| macOS | sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder | Asks for your password and prints nothing when it works |
| Linux with systemd-resolved | resolvectl flush-caches | resolvectl statistics shows the cache size before and after |
| Linux with nscd | sudo nscd -i hosts | Only if nscd is installed and caching hosts |
| Linux with dnsmasq | sudo systemctl restart dnsmasq | Restarting empties its cache |
| Android | Turn airplane mode on and off, or restart | There is no user command; Private DNS settings decide which resolver is used |
| iPhone and iPad | Turn airplane mode on and off, or restart | A configured DNS profile or VPN may send lookups elsewhere |
Many Linux systems without systemd-resolved, nscd or dnsmasq keep no system-wide cache at all; each application asks the resolver directly.
Step 3: clear the browser cache
Browsers keep their own short-lived host cache and reuse open connections, so a page can keep loading from the old server for a while after the system cache is clear.
| Browser | Where | What to press |
|---|---|---|
| Chrome | chrome://net-internals/#dns | Clear host cache, then on chrome://net-internals/#sockets Flush socket pools |
| Edge | edge://net-internals/#dns | Clear host cache, then Flush socket pools on the Sockets page |
| Firefox | about:networking#dns | Clear DNS Cache |
| Safari | Uses the macOS cache | Flush macOS as above and reopen the tab |
If the browser uses DNS over HTTPS (Firefox's DNS over HTTPS setting or Chrome's Use secure DNS), it asks that provider directly and skips your system resolver and router. Clearing those does nothing for the browser; the provider's cache is what matters.
Step 4: the router and public resolvers
- Home and office routers often run a small caching resolver. Restarting the router clears it; some have a flush option in their admin page.
- Public resolvers let you ask them to drop one name: Cloudflare 1.1.1.1 and Google Public DNS both have purge pages, linked below. The purge only affects that service.
- ISP and company resolvers can only be cleared by their operators. Usually it is quicker to wait for the TTL, or to point a test machine at a public resolver.
When flushing will not help
| Situation | What to do instead |
|---|---|
| The authoritative servers still give the old or wrong answer | Fix the record at the DNS provider. Check that you edited the zone the domain is actually delegated to. |
| The nameservers disagree with each other | Compare the SOA serial on each server. One that is behind usually has a zone transfer problem at the provider. |
| An entry in the hosts file overrides DNS | Remove it from C:\Windows\System32\drivers\etc\hosts or /etc/hosts |
| A VPN or security product supplies its own DNS | Disconnect it to compare, or ask its administrator to clear its cache |
| The name did not exist when someone looked it up | The "does not exist" answer is cached for the zone's negative TTL. See negative caching. |
| The DNS is right but the old site still appears | That is a web cache, a CDN or a service worker, not DNS. Try a private window or another device. |
Step 5: confirm it worked
Run the same commands from step 1 again. The system answer (Resolve-DnsName, dscacheutil or getent) should now match the authoritative one. If you are planning a change, lowering the TTL in advance makes all of this unnecessary for most users: see planning a DNS change without downtime.
How DNS Panopticon helps
The DNS Propagation Checker asks the domain's authoritative nameservers and public resolvers around the world for the same record and shows the TTL each one has left, so you can tell straight away whether the problem is the record itself or a cache near you. It cannot see or clear the caches on your own device, browser or router; those are the steps in this guide.
FAQ
Do I need to clear my DNS cache after changing a DNS record?
Usually not. Your own cache only matters if you looked the name up recently. Everyone else will see the change when their resolver's copy expires, which is why lowering the TTL before a change matters more than flushing.
Can I clear DNS caches for everyone?
No. Each resolver keeps its copy until the TTL runs out. You can clear your own device, browser and router, and ask Cloudflare and Google to purge one name on their public resolvers.
Is it safe to flush the DNS cache?
Yes. The only effect is that the next lookups go to the resolver again, which may make the first page loads slightly slower.
Why does nslookup show the new address while my browser still uses the old one?
nslookup asks the resolver directly and skips the operating system and browser caches. Clear the browser's host cache and close its open connections, or restart the browser.