1. Library
  2. Dns
  3. Troubleshooting

Updated 2 hours ago

Your computer remembers where websites live. When you visit example.com, it stores the IP address so it doesn't have to ask for directions next time. This usually works beautifully—until the website moves and your computer keeps going to an address where nobody lives anymore.

Flushing your DNS cache makes your computer forget everything it learned about where websites live. Fresh start. Ask for directions again.

The Problem Nobody Warns You About

DNS cache exists at multiple levels:

  1. Your operating system keeps an address book
  2. Your browser keeps its own separate address book
  3. Your ISP's DNS servers keep their own cache

Flushing your OS cache doesn't touch your browser. Flushing your browser doesn't touch your ISP. This is why people flush their cache, reload the page, see no change, and conclude "that didn't work."

It might have worked. You just didn't flush the right layer.

When Flushing Actually Helps

A website moved and you can't reach it. Works for everyone else. Your computer keeps trying the old address.

You changed your DNS settings. Switched to Cloudflare or Google DNS? Flush to start using them immediately instead of waiting hours for old entries to expire.

Some sites work, others don't. You can reach Google but not your company's website. Stale DNS is a likely suspect.

You're testing DNS changes. Developers and sysadmins flush constantly when working with DNS records.

The Commands

Windows

Open Command Prompt as Administrator:

ipconfig /flushdns

You'll see: "Successfully flushed the DNS Resolver Cache."

To see what's cached before you flush:

ipconfig /displaydns

PowerShell alternative:

Clear-DnsClientCache

macOS

Open Terminal:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Enter your password. No confirmation appears—silence means success.

Linux

Most modern distributions use systemd-resolved:

sudo systemd-resolve --flush-caches

Verify with:

sudo systemd-resolve --statistics

Look for "Current Cache Size: 0"

For systems using nscd:

sudo systemctl restart nscd

Some Linux distributions don't cache DNS locally by default. If these commands fail, your system probably isn't caching DNS at the OS level—which means there's nothing to flush.

Now Flush Your Browser

This is the step people skip. Your browser maintains its own DNS records, separate from your OS.

Chrome and Edge: Type chrome://net-internals/#dns in the address bar. Click "Clear host cache." For a complete reset, also visit chrome://net-internals/#sockets and click "Flush socket pools."

Firefox: Type about:networking#dns in the address bar. Click "Clear DNS Cache."

Safari: Uses the system cache—flushing macOS flushes Safari.

Flushing your OS cache while leaving your browser's cache intact is like clearing your contacts but leaving your spouse's phone unchanged—you're still going to the old address when they drive.

Verify It Worked

After flushing, force a fresh DNS query:

nslookup example.com

On Linux or macOS:

dig example.com

The query time tells you whether you hit cache (under 1ms) or made a real lookup (slower).

When Flushing Won't Help

Flushing DNS solves DNS problems. It does nothing for:

  • Servers that are actually down
  • Your Internet connection being broken
  • Firewall rules blocking traffic
  • Router issues (try restarting it)
  • Problems at your ISP

If flushing doesn't fix it, the problem isn't your computer's memory—it's somewhere else in the chain.

Frequently Asked Questions About Flushing Your DNS Cache

Was this page helpful?

😔
🤨
😃
Flushing Your DNS Cache • Library • Connected