How to Clear Your DNS Cache: Windows ipconfig vs macOS dscacheutil for Refreshing DNS

Clear your DNS cache when a website still points to the old server, fails after a DNS change, or keeps loading stale results. On Windows, use ipconfig /flushdns; on macOS, use sudo dscacheutil -flushcache and usually restart the DNS responder with sudo killall -HUP mDNSResponder. Microsoft documents ipconfig /flushdns as the command that flushes and resets the DNS resolver cache [source: Microsoft].

TLDR: Windows users should open Command Prompt or PowerShell and run ipconfig /flushdns. macOS users should open Terminal and run sudo dscacheutil -flushcache, then sudo killall -HUP mDNSResponder. For example, if your company moved intranet.example.com to a new server at 9:00 a.m. and 30% of staff still reach the old page at 9:20 a.m., clearing DNS cache can fix the local delay. If the problem remains, the issue may be browser cache, router DNS, or the public DNS record itself.

What DNS cache does

DNS turns domain names into IP addresses. Your computer stores recent answers in a local cache so it does not have to ask a DNS server every time you open a site. That makes browsing faster. It can also make troubleshooting annoying.

If a domain changes IP address, your machine may keep using the old answer until the cached entry expires. That expiration is controlled by the record’s TTL, or time to live. A TTL might be 60 seconds, 300 seconds, or several hours. When you flush the DNS cache, you force the operating system to ask again.

Windows: clear DNS cache with ipconfig

On Windows 10, Windows 11, and most supported Windows Server versions, the standard command is simple:

ipconfig /flushdns

Use these steps:

  1. Click Start.
  2. Type cmd or PowerShell.
  3. Choose Run as administrator. This avoids permission trouble.
  4. Run ipconfig /flushdns.
  5. Look for: Successfully flushed the DNS Resolver Cache.

That message means Windows removed its local DNS resolver entries. It does not clear every DNS cache in the chain. Your browser, router, VPN client, or upstream DNS provider may still hold answers.

Honestly, it feels like Windows should show more detail here. The success message is clean, but it tells you nothing about what was removed. If you want to inspect cached entries before clearing them, run:

ipconfig /displaydns

This can produce a long list. Expect clutter from ad networks, update services, internal tools, and background apps. Still, it is useful when you need proof that a stale name exists locally.

macOS: clear DNS cache with dscacheutil

On current macOS versions, flushing DNS usually takes two commands:

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Use these steps:

  1. Open Terminal.
  2. Run sudo dscacheutil -flushcache.
  3. Enter your Mac password when asked. Terminal may not show characters while you type.
  4. Run sudo killall -HUP mDNSResponder.
  5. Try the site again.

The first command clears the system cache. The second tells mDNSResponder, the macOS DNS responder service, to reload. Apple has changed DNS behavior across macOS releases, so older articles often list different commands. For most modern Macs, the two-command method is the safer choice.

The irritating part is that macOS often returns no success message. No green check. No friendly confirmation. You run the command, lose 10 seconds wondering if it worked, then test the site manually. That silence is normal.

Image not found in postmeta

Windows vs macOS: key differences

Task Windows macOS
Main command ipconfig /flushdns sudo dscacheutil -flushcache
Extra step Usually none sudo killall -HUP mDNSResponder
Admin rights Best run as administrator Requires sudo
Success message Usually visible Usually no output
Cache inspection ipconfig /displaydns More limited and less convenient

The practical difference is this: Windows is more direct, while macOS is quieter and slightly less obvious. Both methods are safe for routine troubleshooting. Neither command deletes files, browser history, passwords, or saved Wi-Fi settings.

When flushing DNS actually helps

DNS flushing is useful in specific cases. It is not a magic repair button.

  • A website moved to a new server. Your machine still has the old IP address.
  • An internal company app changed records. VPN users may get mixed results.
  • You changed DNS providers. Your device may still use cached answers from earlier lookups.
  • A site fails on one device only. Other devices on the same network work fine.
  • Developers updated local testing records. The browser keeps opening the wrong environment.

Here is a common case. A team changes app.company.test from 10.20.1.15 to 10.20.1.40. The DNS console is correct. The server is online. Yet one laptop still hits the old app. A DNS flush takes less than one minute and often saves a pointless support ticket.

When it will not fix the problem

If flushing DNS does not work, do not keep repeating the command. Check the next layer.

  • Browser DNS cache: Chrome, Edge, and Firefox can keep their own network state.
  • Router cache: Some home and office routers cache DNS responses.
  • VPN DNS: A VPN client may override normal DNS settings.
  • Wrong DNS record: The public record may still point to the old address.
  • Slow propagation: Recursive DNS servers may wait until TTL expires.
  • Hosts file entries: A manual entry can override DNS completely.

To test the actual answer your machine receives, use nslookup:

nslookup example.com

You can also query a specific resolver:

nslookup example.com 8.8.8.8

If two resolvers return different IP addresses, the issue is likely outside your laptop. If your device alone returns the wrong address, local cache or local configuration is more likely.

Image not found in postmeta

Best practice after clearing DNS

After you flush the cache, close and reopen the browser tab. If that fails, restart the browser. For stubborn cases, disconnect and reconnect VPN, then test again. If the issue affects many users, check authoritative DNS records before asking everyone to run commands.

For IT teams, keep TTLs low before planned migrations. A TTL of 300 seconds, set ahead of a server move, can reduce user impact. After the migration is stable, raise the TTL again if that fits your policy.

Quick command reference

  • Windows flush: ipconfig /flushdns
  • Windows view cache: ipconfig /displaydns
  • macOS flush: sudo dscacheutil -flushcache
  • macOS restart responder: sudo killall -HUP mDNSResponder
  • Test DNS: nslookup domain.com

Use Windows ipconfig when the device is Windows. Use macOS dscacheutil plus mDNSResponder when the device is a Mac. The goal is the same: remove stale local DNS answers and force a fresh lookup. It is fast, low-risk, and often the cleanest first step when a domain points to the wrong place.

Arthur Brown
arthur@premiumguestposting.com
No Comments

Sorry, the comment form is closed at this time.