How to Flush the DNS Cache on macOS (Sequoia, Sonoma, Ventura)

Learn how to clear your DNS cache on macOS with one terminal command. Fixes stale DNS records after domain changes, broken redirects, and weird resolution issues.

DNS cache problems are easy to misdiagnose. You update a domain’s records, wait for propagation, then open a browser and the old site still loads. Or a site that used to work suddenly refuses to connect. The server is fine. Your internet is fine. The issue is that your Mac cached an outdated DNS answer and is still serving it.

Flushing the DNS cache tells macOS to forget those stored answers and ask again from scratch. It takes one command and about five seconds.

Why your Mac caches DNS records

Every time you visit a website, your Mac has to translate the domain name (like example.com) into an IP address. That translation goes through a process: your Mac checks its local DNS cache first, then asks a DNS resolver (usually your ISP’s or a public one like 1.1.1.1), and if neither has the answer, the resolver contacts the authoritative nameserver for that domain.

Caching is a good thing normally. It makes browsing faster because your Mac skips the whole lookup chain for sites you’ve visited recently. The problem shows up when DNS records change and your Mac’s cached answer still points to the old destination. The TTL (time to live) on a DNS record tells resolvers how long to cache it, but macOS doesn’t always respect it precisely.

When a DNS flush actually helps

Not every network problem is a DNS cache issue. A flush helps when:

  • You just changed a domain’s DNS records and your Mac is still resolving to the old IP
  • A site redirects to the wrong place even though the DNS change has propagated everywhere else
  • You switched from a VPN or custom DNS setup and some domains are resolving incorrectly
  • A domain that definitely exists returns “server not found” on your machine but resolves fine elsewhere

If a site is just slow, or connections time out, or you’re getting TLS errors, flushing DNS probably won’t help. Those are different problems.

The command to flush DNS cache on macOS

The command is the same across recent macOS versions. Open Terminal (find it in Applications > Utilities, or search with Spotlight) and run:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Type your password when prompted. Terminal won’t show characters as you type, which is normal. You won’t see any confirmation output when it succeeds, which is also normal.

This command works on:

  • macOS Sequoia (15.x)
  • macOS Sonoma (14.x)
  • macOS Ventura (13.x)

It also works on Monterey and Big Sur if you’re still on those versions.

The command does two things. dscacheutil -flushcache clears the directory services cache, which includes DNS. killall -HUP mDNSResponder sends a signal to macOS’s DNS responder process, telling it to reload. You need both. Running only dscacheutil used to be enough on older versions of macOS but stopped being sufficient years ago.

The sudo prefix is required because these are system-level operations. Without it, both commands will fail silently or return a permissions error.

Verifying the flush worked

After flushing, open a new browser tab and visit the domain you were having trouble with. If the issue was stale cache, you should see the correct site.

For a more definitive check, you can do a DNS lookup and confirm the IP address you’re getting matches what you expect. NetUtil’s DNS Lookup tool makes this quick: open the app, go to DNS Lookup, type in the domain, and run the query. The result shows the A record (IPv4 address) or AAAA record (IPv6) that your Mac is now resolving to. If the IP matches your updated DNS record, the flush worked and the new record is being picked up.

If you see the old IP, the issue isn’t your local cache. It’s probably still propagating through upstream resolvers, or the DNS change hasn’t fully taken effect yet. In that case, wait a few minutes and try again.

You can also use Terminal directly with nslookup example.com or dig example.com to check the resolved IP.

One flush, done

Flushing DNS on macOS is a one-liner that takes seconds. The result doesn’t persist in any visible way, it just clears out stale cached answers so your Mac starts fresh. If the DNS change you’re waiting on has propagated, you’ll be resolving correctly immediately after. If it hasn’t, the flush still won’t cause any harm, and you can re-run it once propagation catches up.

NetUtil includes a DNS Lookup tool alongside Ping, Traceroute, Whois, Port Scan, and Netstat. It’s a free macOS app that replaces the Network Utility Apple removed in macOS Big Sur.