New Customers: 50% OFF Your First Month on All VPS Servers & Web Hosting Plans!

How do I flush my DNS cache?

DNS caching speeds up lookups but can serve stale results. This guide shows you how to flush the cache on Windows, macOS, Linux servers, and in browsers. It includes verification steps and common fixes when the flush does not work as expected.

HostworldDomains & DNS 3 min read Updated 23 Sep 2026

Run the appropriate command for your system: Windows ipconfig /flushdns (or PowerShell Clear-DnsClientCache), macOS sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, Linux resolvectl flush-caches. If your browser uses DNS-over-HTTPS, clear its in‑browser DNS cache as well.

Before you start

  • You need to run these commands with Administrator or root rights.
  • Windows only: ipconfig /flushdns fails if the DNS Client (Dnscache) service is disabled.
  • Even after a local flush, other resolvers may still cache old answers until their TTL expires.

Step 1: Flush the DNS cache on your device or server

Windows 11/10 (client)

This clears the Windows DNS resolver cache so the next lookups are fetched fresh.

ipconfig /flushdns

In PowerShell, this cmdlet does the same job:

Clear-DnsClientCache

Windows Server with the DNS Server role

This clears the server-side cache on a Microsoft DNS server that answers many clients. Every client relying on that server loses its cached answers at the same time, so do not run it casually on a production or shared resolver. Do it during a change window, or when you are deliberately clearing a bad record.

In PowerShell:

Clear-DnsServerCache -ComputerName localhost -Force

Command line alternative:

dnscmd /clearcache

macOS 12, 13, 14, 15

These commands flush both the directory service cache and signal the DNS responder to drop cached entries. No success message is printed.

sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Linux with systemd-resolved

This purges the local stub resolver’s cache managed by systemd-resolved.

sudo resolvectl flush-caches

Tip: if /etc/resolv.conf points to 127.0.0.53 or is a symlink to a systemd-resolved file, you are using systemd-resolved.

Linux servers running a local resolver

Use the method for the resolver you run on the host.

  • dnsmasq: SIGHUP empties its cache and reloads config
sudo killall -HUP dnsmasq
  • Unbound: flush all or specific entries
sudo unbound-control flush
# or, for a zone:
sudo unbound-control flush_zone example.com
  • BIND (named): flush all or a single name
sudo rndc flush
# or, for one hostname:
sudo rndc flushname example.com

Browsers

Browsers keep their own DNS cache. Clear it here if you use DNS-over-HTTPS or want to be thorough.

  • Chrome or Chromium: visit chrome://net-internals/#dns then click Clear host cache. Then visit chrome://net-internals/#sockets and click Flush socket pools.
  • Microsoft Edge: visit edge://net-internals/#dns then click Clear host cache.
  • Firefox: visit about:networking#dns then click Clear DNS Cache.

Step 2: Verify the flush

Restart the applications that were getting the stale answer first, including your browser and any mail client or service that holds long-lived connections. They can keep using a resolved address even after the system cache is empty. Then confirm the cache is clear or that fresh answers are being fetched.

  • Windows: show the client cache
ipconfig /displaydns
  • Windows: test a lookup
nslookup yourdomain.tld
  • Linux with systemd-resolved: check stats and query
resolvectl statistics
resolvectl query yourdomain.tld

On macOS, run your lookup or load the site again. The commands in Step 1 produce no success output. If results have not changed, upstream caches may still be honouring the previous TTL or negative cache.

If it does not work

  • Windows error “Could not flush the DNS Resolver Cache: Function failed during execution”: the DNS Client (Dnscache) service is stopped or disabled. Start or re‑enable the DNS Client service, then run the command again.
  • Your browser ignores the OS cache: DNS-over-HTTPS can bypass the system resolver. Clear the in‑browser DNS cache using the browser steps above or turn off DoH, then retest.
  • You flushed the device, but answers are still old: recursive resolvers cache records and NXDOMAIN responses for their TTL. Wait for TTL expiry or, if you run the resolver yourself, flush it using the dnsmasq, Unbound, BIND or Windows DNS Server steps above.
  • The application still has the old address: restart it, and restart the service that depends on it, before assuming the flush failed.

What next

If this was part of changing DNS for a Hostworld server, you may also want to review record changes and TTL planning. For broader context and server-side tasks, see our VPS guides. If you are still stuck or need us to check from our side, please open a support ticket and include the domain and what you are expecting to see.

Common questions

What command flushes DNS cache on Windows?

Run ipconfig /flushdns in Command Prompt or Clear-DnsClientCache in PowerShell, both with Administrator rights.

How do I clear DNS cache on macOS?

Run sudo dscacheutil -flushcache followed by sudo killall -HUP mDNSResponder.

How do I flush DNS on Linux?

For systemd-resolved systems, run sudo resolvectl flush-caches. For other resolvers like dnsmasq, BIND, or Unbound, use the specific commands for that resolver.

Do I need to clear DNS cache in my browser?

Yes, if your browser uses DNS-over-HTTPS, as it maintains its own cache separate from the system resolver.

Why does flushing DNS not work?

Common causes are the DNS Client service being disabled on Windows, browsers using DNS-over-HTTPS, or upstream caches still honouring the old TTL. Check the troubleshooting section for specific fixes.

Was this article helpful?