Flush DNS first when a website opens in the wrong place, refuses to load, or still shows an old server after a change. On Windows, use ipconfig /flushdns. On macOS, use sudo dscacheutil -flushcache, then refresh the responder with sudo killall -HUP mDNSResponder. Microsoft says ipconfig /flushdns clears the DNS resolver cache, which is the little address book your computer keeps for websites [source: Microsoft].

TLDR: DNS cache is like your computer saying, “I already know where that site lives,” even when it may be wrong. On Windows, open Command Prompt and run ipconfig /flushdns. On macOS, open Terminal and run sudo dscacheutil -flushcache, then sudo killall -HUP mDNSResponder. Example: if your company moved a site at 9:00 AM and 3 out of 10 users still hit the old server at 9:15 AM, flushing DNS is a smart first fix.

What DNS cache actually does

DNS turns names into numbers.

You type example.com. Your computer needs an IP address. That address may look like 93.184.216.34. Humans like names. Computers like numbers.

To save time, your system stores recent DNS answers. That is the DNS cache. It stops your device from asking the same question again and again.

Most of the time, this is great. Pages load a bit faster. Apps connect quicker. Everyone is happy.

Until it is wrong.

Then it is annoying. Really annoying. You know the site moved. Your coworker can see it. Your phone can see it. Your laptop acts like it missed the meeting.

Flush the Local DNS Cache

When should you flush DNS?

Flush DNS when things feel weird, but the internet is not fully broken.

  • A website moved to a new server.
  • You changed DNS records for a domain.
  • A site works on mobile data, but not on Wi-Fi.
  • Only one machine gets the old page.
  • You see “server not found” for a site that works for others.
  • You use a VPN and sites resolve to odd places.
  • You changed your hosts file and want a clean test.

The catch is that flushing DNS is not magic. It clears the local cache. It does not fix bad DNS records. It does not force the whole internet to update. It also does not clear every browser cache by itself.

Windows: flushing DNS with ipconfig

Windows keeps a DNS resolver cache. The classic tool for clearing it is ipconfig.

Here is the simple way:

  1. Press Windows.
  2. Type cmd.
  3. Open Command Prompt.
  4. Type this command:
ipconfig /flushdns

Press Enter.

If it worked, you should see something like:

Successfully flushed the DNS Resolver Cache.

That message is nice. Windows gives you a clear thumbs up. No detective work needed.

You can also use PowerShell. The same command works there:

ipconfig /flushdns

If the command fails, try opening Command Prompt as an administrator. Right-click it. Choose Run as administrator. Then try again.

macOS: flushing DNS with dscacheutil

macOS is a little more “guess what happened.” Honestly, it feels like the Mac command line enjoys silence too much.

For most modern macOS versions, use two commands:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Press Enter after each line.

The first command clears cache data handled by macOS. The second tells mDNSResponder to reload. That service helps manage DNS responses on macOS.

You may need to type your Mac password. You will not see letters or dots while typing. That is normal. Type the password anyway, then press Enter.

Here is the part that trips people up. macOS often shows no success message. Nothing. Just a new Terminal line.

It drives me crazy that a command can work and still say nothing. But that is normal on macOS. No error usually means success.

Windows vs macOS: what is the real difference?

The goal is the same. Clear old DNS answers.

The tools feel different.

System Main command Feedback Difficulty
Windows ipconfig /flushdns Usually shows a success message Easy
macOS sudo dscacheutil -flushcache Usually silent Easy, but less friendly

Windows feels more direct. One command. Clear result. Done.

macOS often needs two commands. The main one is dscacheutil. The extra one restarts or nudges the DNS responder process. That helps the flush take effect cleanly.

Neither is “better” in a huge way. They just have different habits. Windows talks more. macOS shrugs and walks away.

A quick real-life example

Say you run a small bakery website.

You move from an old host to a new host. Your DNS record now points to the new server. Your designer sees the new site. Your phone sees it too.

But the shop laptop still opens the old menu. It has the wrong holiday hours. Customers keep calling. Great. Perfect morning.

On the Windows laptop, run:

ipconfig /flushdns

Close the browser. Open it again. Try the site.

On a MacBook, run:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Then reopen the browser.

If the site now works, the local DNS cache was the problem. You just saved yourself a support ticket and maybe 30 minutes of grumbling.

What if flushing DNS does not fix it?

Then the stale answer may live somewhere else.

  • Browser DNS cache: Chrome and Edge may keep their own host cache.
  • Router cache: Some routers store DNS answers.
  • ISP DNS cache: Your internet provider may still have old data.
  • Public DNS resolver: Services like Google DNS or Cloudflare may update on their own timing.
  • Bad DNS record: The record itself may be wrong.
  • TTL delay: DNS records have a time limit called TTL. Some caches wait until it expires.

If you use Chrome, you can also try closing every browser window. Then reopen it. If that fails, use another browser as a quick test.

You can also restart the router. Yes, it is boring. Yes, it still works more often than it should.

How to check what DNS answer you are getting

Flushing is step one. Checking is step two.

On Windows, use:

nslookup example.com

On macOS, use:

dig example.com

Replace example.com with your real domain.

Look at the IP address returned. Is it the new one? Good. Is it the old one? Something is still cached, or the DNS record has not fully updated.

What Does Slow DNS Lookup Mean?

Simple safety tips

  • Flushing DNS is safe.
  • It does not delete files.
  • It does not erase passwords.
  • It does not reset your whole network.
  • It may make the next website visit a tiny bit slower.

That tiny delay happens because your computer has to ask DNS again. After that, it stores fresh answers.

The best rule of thumb

Use ipconfig /flushdns on Windows. Use sudo dscacheutil -flushcache plus sudo killall -HUP mDNSResponder on macOS.

If one device sees the old site and another sees the new one, flush DNS first. It is quick. It is safe. It fixes many “why is this still broken?” moments.

If it still fails, check the browser, router, DNS record, and TTL. Start close to your machine. Then work outward.

DNS problems can feel spooky. They are usually not. Most of the time, your computer is just holding an old address and acting far too confident about it.