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.

CommandWhich layer answers
dig +short example.com NSThe domain's nameservers, to use in the next command
dig +norecurse @ns1.example.com www.example.com AThe authoritative server: the truth, with no cache in the way
dig www.example.com AYour configured recursive resolver, with the TTL it has left
Resolve-DnsName www.example.com -Server ns1.example.com -DnsOnlyThe authoritative answer from Windows PowerShell
Resolve-DnsName www.example.comWhat Windows itself returns, including its cache and the hosts file
dscacheutil -q host -a name www.example.comWhat macOS itself returns
getent hosts www.example.comWhat 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

SystemCommand or actionNotes
Windows 10 and 11ipconfig /flushdnsFrom Command Prompt or PowerShell. Run it as administrator if it reports that access is denied.
Windows PowerShellClear-DnsClientCacheThe same flush. Get-DnsClientCache lists what is cached.
macOSsudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderAsks for your password and prints nothing when it works
Linux with systemd-resolvedresolvectl flush-cachesresolvectl statistics shows the cache size before and after
Linux with nscdsudo nscd -i hostsOnly if nscd is installed and caching hosts
Linux with dnsmasqsudo systemctl restart dnsmasqRestarting empties its cache
AndroidTurn airplane mode on and off, or restartThere is no user command; Private DNS settings decide which resolver is used
iPhone and iPadTurn airplane mode on and off, or restartA 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.

BrowserWhereWhat to press
Chromechrome://net-internals/#dnsClear host cache, then on chrome://net-internals/#sockets Flush socket pools
Edgeedge://net-internals/#dnsClear host cache, then Flush socket pools on the Sockets page
Firefoxabout:networking#dnsClear DNS Cache
SafariUses the macOS cacheFlush 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

SituationWhat to do instead
The authoritative servers still give the old or wrong answerFix the record at the DNS provider. Check that you edited the zone the domain is actually delegated to.
The nameservers disagree with each otherCompare 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 DNSRemove it from C:\Windows\System32\drivers\etc\hosts or /etc/hosts
A VPN or security product supplies its own DNSDisconnect it to compare, or ask its administrator to clear its cache
The name did not exist when someone looked it upThe "does not exist" answer is cached for the zone's negative TTL. See negative caching.
The DNS is right but the old site still appearsThat 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.

Sources and further reading