Skip to Main Content
Back to ResourcesEmail News

How to Flush DNS Cache on Mac, Windows & Linux

Dominic LandryBy Dominic LandryAugust 9, 2023Updated July 19, 20265 min read

In brief

Clear your DNS cache in one command (macOS, every Windows version, and Linux distros) plus how to flush browser DNS and confirm it worked.

How to Flush DNS Cache on Mac, Windows & Linux

The Domain Name System (DNS) translates human-readable domain names into the IP addresses computers actually connect to. To speed things up, your operating system caches those lookups locally, but a stale cache can serve outdated records, which is exactly the problem when you've just changed an MX, TXT, or CNAME record and the old value keeps resolving. Flushing the DNS cache forces your system to fetch fresh data. The command differs by operating system: ipconfig /flushdns on Windows, sudo killall -HUP mDNSResponder on macOS, and sudo resolvectl flush-caches on most Linux distributions running systemd-resolved.

What the flush DNS command does

The flush command tells your operating system to discard its cached DNS entries, so the next lookup for any domain retrieves current data from your DNS servers. It's the fastest fix when a record change hasn't taken effect locally, when a site resolves to the wrong address, or when you're troubleshooting connectivity that points at DNS.

Three-column comparison of the DNS cache flush steps for Windows, macOS, and Linux. Each OS has its own flush command; Linux commands vary by distribution.

Each operating system has its own command, so let's walk through Windows, macOS, and Linux in turn.

Flushing DNS cache on Windows

  1. Open Command Prompt as an administrator. Press the Windows key, type "Command Prompt," right-click it, and choose "Run as administrator."
  2. Run the flush command. Type ipconfig /flushdns and press Enter. Windows clears its resolver cache.
  3. Confirm it worked. You should see the message "Successfully flushed the DNS Resolver Cache."
This same command works on every supported Windows version, from Windows 7 through Windows 11 and Windows Server. If you want to see what's currently cached before you clear it, run ipconfig /displaydns.

Flushing DNS cache on macOS

  1. Open Terminal. Go to Applications → Utilities and launch Terminal.
  2. Run the flush command. Type sudo killall -HUP mDNSResponder and press Enter. This signals mDNSResponder, the process responsible for DNS caching, to clear its cache.
  3. Enter your password. You'll be prompted for your administrator password; it won't display as you type. Press Enter.
This command covers current macOS releases. macOS doesn't print a success message, so no output means it worked. Verify with a lookup as shown below.

Flushing DNS cache on Linux

Linux distributions handle DNS caching differently, so the command depends on which resolver your system runs.

  1. Open a terminal. Use a shortcut like Ctrl+Alt+T or search for "Terminal" in your application launcher.
  2. Run the command for your resolver:
- systemd-resolved: sudo systemd-resolve --flush-caches (or sudo resolvectl flush-caches on newer releases). - NetworkManager: sudo systemctl restart NetworkManager. - dnsmasq: sudo systemctl restart dnsmasq.

If you're unsure which resolver you use, systemd-resolved is the default on most modern distributions. Consult your distribution's documentation for anything unusual.

Flushing your browser's DNS cache

Browsers keep their own DNS cache that survives an OS-level flush. In Chrome, visit chrome://net-internals/#dns and click "Clear host cache"; in Firefox, DNS is cached briefly and clears on restart. If a site still resolves incorrectly after an OS flush, clear the browser cache too.

When flushing isn't enough

While flushing the cache resolves many issues, some DNS problems need a closer look.

Checklist of four DNS checks to run when flushing the cache does not fix resolution issues. Work through these when a cache flush alone doesn't fix DNS resolution.
  • DNS errors and misconfigurations: Double-check your records with the DNS lookup tool to confirm the published values are what you intended.
  • DNS cache poisoning and spoofing: Keep your DNS software current and use protective measures against cache poisoning.
  • Network connectivity and server availability: Confirm your connection is stable and your DNS servers are reachable.
  • Firewall and security settings: Make sure a firewall or security tool isn't blocking DNS requests on port 53.

Common issues when flushing DNS

The flush command runs but the old record still resolves.

The record's TTL controls how long resolvers upstream of you keep the old value; your local flush can't clear their caches. It can also be your browser's separate cache. Wait for the TTL to expire, flush the browser cache, and confirm with the DNS lookup tool rather than the browser.

"The requested operation requires elevation" on Windows.

ipconfig /flushdns needs administrator rights. Close the window and reopen Command Prompt with "Run as administrator" before running the command again.

macOS shows no confirmation message.

That's expected, killall -HUP mDNSResponder prints nothing on success. If you got no error, the flush worked. Test by resolving a domain that recently changed.

The Linux command isn't found or has no effect.

You're likely targeting the wrong resolver. Check whether systemd-resolved, NetworkManager, or dnsmasq is running with systemctl status, then use the matching command from the list above.

Simplify DNS and email troubleshooting with Palisade

Getting DNS right and keeping it right is the foundation of reliable, secure email. Palisade gives you visibility into your DNS and email-authentication setup, flags misconfigured records before they cause delivery problems, and shows you exactly what to fix. Start with the free Email Security Score to see where your domain stands.

Questions readers ask

Frequently asked questions

Does flushing DNS delete anything important?

No. It only clears cached lookups, which your system rebuilds automatically on the next request. Nothing about your configuration, bookmarks, or files is affected.

How often should I flush my DNS cache?

Only when you need to, typically right after changing a DNS record, or when troubleshooting a site that resolves to the wrong address. There's no benefit to flushing on a schedule.

Why does a record still resolve to the old value after I flush?

Because caching happens at multiple layers. Your OS cache is cleared, but resolvers between you and the authoritative server still hold the old record until its TTL expires. Lowering the TTL before a planned change reduces this delay.

Will flushing DNS fix email delivery problems?

Only indirectly. If you just published a new SPF, DKIM, or DMARC record and are testing locally, a flush lets you see the current value sooner. Verify authentication records with the Email Security Score rather than relying on cached lookups.

Make email authentication easier to manage

Start in Palisade.

Get started

Share this article

Dominic Landry

Written by

Dominic Landry

Deliverability & DNS

Dominic Landry works on email deliverability and DNS configuration at Palisade, from SPF and DKIM records through to DMARC enforcement.

More from Dominic →

Related articles and tools