← All articles

25 April 2026

How to flush DNS cache on macOS (and when it fixes connectivity)

What the macOS DNS cache does, why stale entries break sites, exact Terminal commands for Ventura through Sequoia (and older releases), and what to try if flushing alone is not enough.

A "Server Not Found" or "This site can't be reached" message when the rest of the internet seems fine is often not your ISP or your Wi‑Fi—it is a small system cache on your Mac that still points to an old IP address for a hostname. Clearing that cache (a DNS flush) forces a fresh lookup. This guide walks through what DNS caching is, when flushing helps, the exact commands for recent macOS versions, and what to check next if the problem persists.

DNS as a name-to-address lookup (and why macOS caches it)

Computers reach each other using IP addresses; people use domain names. The Domain Name System (DNS) translates names into addresses. When you open a site, your Mac asks configured DNS servers for the current answer.

To save time and traffic, macOS stores those answers in a local DNS cache. The next time you visit the same host, your Mac can reuse the cached IP—often in milliseconds. That is normal and desirable until the answer is no longer true.

Why the cache goes stale

  • Hosting or server moves. A site's IP changes after a migration; your Mac may still use the old IP, leading to errors, timeouts, or wrong content.
  • Incorrect or malicious answers. Wrong DNS data (misconfiguration or interference) can send you somewhere unexpected or block legitimate sites. Flushing drops local cached rows so the next query hits your resolvers again.
  • Network changes. New router, Wi‑Fi changes, or VPN/proxy changes can leave resolver state that no longer matches how traffic should flow.

Flushing the macOS DNS cache does not delete your files, browser history, or passwords. It mainly invalidates stored DNS answers so the next resolution can be current.

Open Terminal and understand sudo

Flushing uses Terminal and commands that start with sudo ("superuser do"), because DNS is tied to system-level services.

Open Terminal: press ⌘ + Space, type Terminal, press Enter.

After you run a sudo command, macOS prompts for your login password. The cursor will not move and no characters appear while you type—that is expected.

Commands by macOS version

Apple's networking stack (including mDNSResponder) has changed over time, so the one-liner can differ by release.

Ventura, Sonoma, Sequoia (13.x, 14.x, 15.x+) and Monterey / Big Sur (12.x, 11.x)

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Catalina and Mojave (10.15, 10.14)

sudo killall -HUP mDNSResponder

dscacheutil -flushcache clears data held by the Directory Service cache utility where that step applies. killall -HUP mDNSResponder reloads the mDNSResponder process—the background service that handles much of macOS DNS and related discovery— without rebooting the whole machine.

How to tell it worked

Terminal usually prints no success banner. If there is no error, you typically just see a new empty prompt. If you get command not found, check spelling and ensure there is a space after sudo.

To retest: open your browser in a Private / Incognito window (browsers keep their own caches separate from the OS) and try the site that failed before.

If flushing macOS DNS is not enough

Browser DNS (Chrome)

Chrome maintains its own DNS cache. Open chrome://net-internals/#dns in the address bar and use Clear host cache.

Router-level DNS

Home routers often cache DNS too. If several devices show the same symptom, power-cycle the router (unplug about 30 seconds, plug back in) or review its admin UI for DNS or cache options.

Try different DNS servers

If your ISP's resolvers are slow or unreliable, you can set alternatives in macOS network settings—for example Cloudflare 1.1.1.1 or Google 8.8.8.8. Use providers you trust, and follow org policy on managed machines.

When flushing is a good first step

  • Right after a site or server you rely on has moved hosts.
  • When you see errors such as DNS_PROBE_FINISHED_NXDOMAIN.
  • After VPN, proxy, or major network profile changes.

Takeaway: Flushing DNS on a Mac is a low-risk, high-leverage troubleshooting step: it resets the local map so the next lookup uses current data—then narrow down browser, router, or upstream DNS if the issue persists.