How to Flush DNS (Clear the DNS Cache)

One command per system, what the DNS cache is, and when clearing it actually helps.

To flush DNS on Windows, open Command Prompt and run ipconfig /flushdns. On a Mac, run sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder in Terminal. On a phone, turn Airplane mode on and off. Chrome keeps its own cache: open chrome://net-internals/#dns and click Clear host cache.

No button can do it for you

A web page can't clear your device's DNS cache, so this page shows the command for your system (it's open below) with a copy button. To see whether a site's address has really changed, look it up with our DNS lookup or the DNS propagation checker.

Flush DNS Commands for Every System

One command per system: run it, then reload the site. On phones there's no command: Airplane mode on and off, or a restart, is the usual way to clear it.

SystemFlush DNS commandWhere to run it
Windows 11 and 10ipconfig /flushdnsCommand Prompt (cmd)
Windows, PowerShellClear-DnsClientCachePowerShell or Windows Terminal
Mac (macOS)sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderTerminal, then your password
Linuxsudo resolvectl flush-cachesTerminal (systemd-resolved)
Chrome, Edgechrome://net-internals/#dnsAddress bar › Clear host cache (Edge: edge://)
Firefoxabout:networking#dnsAddress bar › Clear DNS Cache

What Is the DNS Cache?

The DNS cache is a short list of website addresses your device remembers, so it doesn't ask a DNS server again every time you open the same site.

When you open a site, your device asks a DNS server for its IP address and keeps the answer for as long as the site's owner allows: the TTL (time to live) that comes with every DNS answer, defined in RFC 1035. It can be a minute or a day. Your browser keeps a second copy, your router often a third, and your DNS server a fourth.

Flushing empties your device's copy. The next lookup goes back to the DNS server and gets the current address.

A website's address is cached in four places: the browser (clear it at chrome://net-internals/#dns), your device (ipconfig /flushdns or Airplane mode), the router (unplug it for 30 seconds) and the DNS server (wait out the TTL or use its purge page)

When Flushing DNS Helps, and When It Doesn't

Flush it when a site moved, won't open on one device only, or shows an old version; it won't make your internet faster.

SituationDoes flushing help?
A site moved to a new server or hostYes: your device drops the old address
"DNS server not responding", DNS_PROBE_FINISHED_NXDOMAINOften, together with a router restart: see DNS server not responding and DNS_PROBE_FINISHED_NXDOMAIN
You just changed your DNS serverYes: answers from the old server are cleared
A site opens on your phone but not on your computerYes, on the computer
Your whole internet is slowNo: DNS is only the first step; run a speed test. If only the start of each page is slow, compare DNS servers with the DNS speed test
The site is down for everyoneNo: the problem is on its side
You suspect a forged answer (DNS cache poisoning)Yes on your device; DNS servers that validate DNSSEC (RFC 4033) reject forged answers

How to Flush DNS on Your System

The steps for the system you're using are open below.

Windows 11 and 10
  1. Press the Windows key, type cmd and open Command Prompt.
  2. Run the command below. Windows answers "Successfully flushed the DNS Resolver Cache."
ipconfig /flushdns

In PowerShell, Clear-DnsClientCache does the same. To see what's in the cache first, run ipconfig /displaydns.

Mac
  1. Open Terminal (Applications › Utilities, or Spotlight: Cmd + Space, "Terminal").
  2. Run the command below and type your password (nothing shows while you type). There's no confirmation message.
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Linux

Most current distributions (Ubuntu, Fedora, Debian with systemd-resolved) cache DNS in systemd-resolved:

sudo resolvectl flush-caches

resolvectl statistics shows the cache size before and after. Some systems have no local DNS cache at all; then there's nothing to flush, and only the browser keeps one.

iPhone and iPad
  1. Turn Airplane mode on in Control Center, wait 10 seconds, turn it off.
  2. Still the old site: restart the iPhone. iOS has no command to clear the DNS cache, so these are the usual ways.
Android
  1. Turn Airplane mode on, wait 10 seconds, turn it off, or restart the phone.
  2. In Chrome on Android, open chrome://net-internals/#dns and tap Clear host cache.
ChromeOS

Open chrome://net-internals/#dns in a tab and click Clear host cache, or restart the Chromebook.

Clear the Browser's DNS Cache: Chrome, Edge and Firefox

Browsers keep their own DNS cache, separate from the system's: clear it too when one site still shows its old address.

  • Chrome: open chrome://net-internals/#dns › Clear host cache, then chrome://net-internals/#sockets › Flush socket pools so open connections to the old address close.
  • Edge: the same pages at edge://net-internals/#dns and edge://net-internals/#sockets.
  • Firefox: open about:networking#dns › Clear DNS Cache.
  • Safari: uses the Mac's cache: the Terminal command above clears it.

Clearing the DNS cache doesn't delete your history, cookies or saved passwords.

The Router's DNS Cache

Most home routers keep a DNS cache too: restarting the router clears it.

Unplug the router for 30 seconds and plug it back in. Do this when every device at home gets the old address, or right after changing the DNS server on the router.

Clear a Domain From Google's or Cloudflare's DNS Cache

If you use Google Public DNS or Cloudflare 1.1.1.1, they keep their own copy of each answer; both offer a free page to clear one domain from it.

  • Google Public DNS (8.8.8.8): the Flush Cache page at developers.google.com/speed/public-dns/cache: enter the domain, pick the record type (A, AAAA, MX…), confirm. After a change of registrar or DNS host, flush the main domain first, then its subdomains.
  • Cloudflare (1.1.1.1): the Purge Cache page at one.one.one.one/purge-cache: enter the domain and the record type. Cloudflare said in 2018 that its resolver keeps answers for at most 3 hours anyway.

This clears their copy for everyone using them, which is what site owners need after moving a site or changing mail (MX) records. Your own device still needs its local flush, above.

Still the Old Site After Flushing?

Then a cache you don't control still holds the old answer: your DNS server's, until the TTL runs out.

  1. Check what the world sees: the DNS propagation checker asks DNS servers in many countries. If most show the new address, yours will follow.
  2. Check what one server answers, and the TTL left, with the DNS lookup.
  3. Don't want to wait: switch to a public DNS server, which may already have the new answer, then flush again.

Frequently Asked Questions

What does flushing DNS do?
It deletes the DNS answers your device has stored, so the next visit to each site asks a DNS server again and gets its current address. It fixes sites that moved or answers that went wrong; it doesn't change your DNS server.
Is it safe to flush DNS?
Yes. Nothing is lost: the cache refills by itself as you browse. The first visit to each site may take a few milliseconds longer, that's all.
How often should I flush DNS?
Only when something is wrong: a site that won't open, or still shows its old version after a move. There's no benefit in flushing on a schedule.
Why does a site still load the old address after flushing?
Another cache still holds it: the browser's own (Chrome, Edge, Firefox), the router's, or your DNS server's, which keeps the old answer until its TTL runs out. Clear the browser's cache, restart the router, or wait for the change to reach every server.
How do I see what's in my DNS cache?
On Windows, run ipconfig /displaydns in Command Prompt: it lists every saved name, its address and the seconds left before it expires. On Linux, resolvectl statistics shows how many entries the cache holds. Chrome's list is at chrome://net-internals/#dns.
What is DNS cache poisoning?
An attack that slips a forged answer into a DNS cache, so people are sent to a fake site under the real name. Flushing your device removes a bad entry from it; DNSSEC lets DNS servers reject forged answers, and big public DNS services validate it.
Do I need administrator rights to flush DNS?
Not on Windows: ipconfig /flushdns works in a normal Command Prompt. On a Mac and on Linux the command starts with sudo, so it asks for your password.

Next steps

Related Tools

DNS Lookup
What a DNS server answers for a domain right now.
DNS Propagation Checker
Has a DNS change reached every country?
DNS Leak Test
Which DNS server answers your lookups.

Related Guides

Guide DNS Server Not Responding
The fixes in order, when no site opens.
Guide How to Change DNS
On the router or one device.
Guide DNS_PROBE_FINISHED_NXDOMAIN
Does the site exist, and whose side is it on?