ForestVPN
Technology

How to Refresh DNS Cache on Mac (macOS 10.4‑Ventura)

Learn the step‑by‑step commands to clear DNS cache on every macOS version from Tiger to Ventura, fixing stale lookups and broken redirects.

11 мин чтения
How to Refresh DNS Cache on Mac (macOS 10.4‑Ventura)

Refresh DNS Mac – Why Your Mac Needs a DNS Cache Refresh

Ever notice a site that suddenly feels like it’s stuck in a time loop? That’s the DNS cache playing tricks. We keep a local directory of domain‑to‑IP lookups, and when those records change, our Mac can still point to the old address. Refreshing that cache is like hitting a reset button on a stubborn browser tab.

When a developer flips servers, or a user sees a broken redirect, stale DNS entries are often the culprit. Imagine a map that still shows a road that’s been closed for months; you’ll end up lost. Clearing the cache forces macOS to fetch fresh data from the authoritative name servers, so every

Version‑Specific macOS Commands: From OS X 10.4 to Ventura

The way you clear DNS on a Mac has changed a lot over the years. Apple tweaked the DNS daemon’s architecture, so older releases use mDNSResponder or discoveryutil, while macOS 10.15 and later require a three‑step routine to flush both the system‑wide and helper caches.

macOS / OS X Version

Terminal Command

Notes

OS X 10.4 – 10.6 (Tiger – Snow Leopard)

sudo killall -HUP mDNSResponder or sudo discoveryutil mdnsflushcache

Requires admin privileges. The discoveryutil command is deprecated but still works on 10.6.

OS X 10.7 – 10.9 (Lion – Mavericks)

sudo killall -HUP mDNSResponder

Same command as earlier releases.

OS X 10.10 – 10.12 (Yosemite – El Capitan)

sudo killall -HUP mDNSResponder

macOS 10.13 (High Sierra)

sudo killall -HUP mDNSResponder

macOS 10.14 (Mojave)

sudo killall -HUP mDNSResponder

macOS 10.15 (Catalina)

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; sudo killall -HUP mDNSResponderHelper

Three‑step command recommended by Apple.

macOS 11 (Big Sur)

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; sudo killall -HUP mDNSResponderHelper

macOS 12 (Monterey)

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; sudo killall -HUP mDNSResponderHelper

macOS 13 (Ventura)

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; sudo killall -HUP mDNSResponderHelper

Every command needs sudo. When you run it, macOS will prompt you for your admin password, and the characters will stay hidden—that’s normal. If you’re not sure which OS you’re on, just type sw_vers -productVersion in Terminal and match the major number with the table above. The single killall command will clear the cache on older systems, but the three‑step sequence guarantees a clean flush on Catalina and later.

Verifying the Flush

Once you’ve run the appropriate command, you can double‑check that the DNS cache is empty by querying a domain you know has recently changed its IP. For example:

bash
1dig @8.8.8.8 example.com
2nslookup example.com

If the output shows the current IP address and you no longer see the old cached result, the cache has been successfully flushed.

FAQ

Why do I get “Operation not permitted” when I run the command? Make sure you are running the command with sudo and that your user account has admin privileges.

What if I don’t have sudo access? You need to log in as an administrator or ask the system admin to run the command for you.

Are there GUI tools to flush the DNS cache? Apple does not provide a built‑in GUI for this, but you can use third‑party utilities such as DNSCache or Dscacheutil GUI to perform the same actions without using Terminal.

Step‑by‑Step Terminal Walkthrough

We’re about to wipe your Mac’s DNS cache clean—think of it as turning a notebook page back to white. Ready? Let’s fire up Terminal and get started.

1. Open Terminal

You can open it via Applications ➜ Utilities ➜ Terminal, or just hit ⌘ + Space, type Terminal, and press Enter. When that black window pops up, you’re in the command‑line playground.

2. Check your macOS version

bash
1sw_vers -productVersion

You’ll see something like 13.4.1. Write that down; it tells us which command to run next.

3. Pick the right command

macOS version

Command to run

10.13 – 10.14

sudo killall -HUP mDNSResponder

10.15 – 11.5

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

12 – 13 (Monterey, Ventura)

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

14 (Sonoma)

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

If you’re on an older OS X, the single killall command is enough. On 10.15 or newer, use the two‑step sequence above.

4. Paste and run the command

Right‑click and choose Paste, or press ⌘ + V. Then hit Enter.

5. Enter your admin password

When a sudo command pops up, type your administrator password—no characters will appear, which is normal—and hit Enter again.

6. Verify the flush

If the command succeeds, Terminal will stay quiet or show something brief like mDNSResponder has been terminated. That silence means the cache is cleared. To double‑check, run:

bash
1dig example.com

or

bash
1nslookup example.com

The ANSWER SECTION should display the current IP from your DNS server. You can also run:

bash
1dscacheutil -statistics

and look for a low cache‑hit count, indicating a fresh cache.

Common pitfalls

  • Forgetting sudoPermission denied error.
  • Typos in the command → command not found.
  • Wrong spacing or semicolons in the three‑step sequence → syntax error.

Quick recap

  1. Open Terminal.
  2. Check macOS version.
  3. Copy the correct command from the table.
  4. Paste and press Enter.
  5. Enter admin password.
  6. Verify with dig/nslookup or dscacheutil -statistics.

That’s it! Your DNS cache is now refreshed. If a browser still shows stale content, clear its cache or restart it.

Confirming the Flush: Verify Your DNS Cache Is Clean

We’ve wiped the cache, but how do we know the job’s done? Think of it as checking a freshly cleaned room for crumbs—there should be none.

1. Quick sanity check with dig

Run dig example.com and watch the ANSWER SECTION. A clean cache will pull fresh data from your DNS server, not a stored reply. If you see a recent IP, the flush worked.

2. Use nslookup for a second opinion

Enter nslookup example.com. A clean cache shows the current IP and the server you queried. If the server name is still the old one, the cache might still hold stale data.

3. Dive into statistics with dscacheutil

Execute dscacheutil -statistics. Look for the dns section. A low hit count or a zero value signals a fresh cache. If the hit count remains high, the cache hasn’t cleared completely.

4. Inspect the cache dump

Run dscacheutil -cachedump | grep example.com. No output means the entry is gone. Any lingering line indicates the cache still remembers the domain.

5. Interpreting the results

  • Fresh IPs and low hit counts: Great, the flush succeeded.
  • Old IPs or high hit counts: The cache still lingers. Try a full three‑step flush again.
  • No output but browsing still broken: The browser may still be caching pages. Restart or clear the browser cache.

6. Troubleshooting when verification fails

Symptom

Likely Cause

Fix

dig returns old IP

Cache not fully cleared

Run full flush: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder; sudo killall -HUP mDNSResponderHelper

nslookup shows old server

Network service cached

Restart network service: sudo ifconfig en0 down && sudo ifconfig en0 up

dscacheutil errors

Wrong command on older macOS

Skip that step; use only killall -HUP mDNSResponder

Browser still shows stale page

Browser cache separate from DNS

Open Develop menu and select Empty Caches or restart the browser

7. Why a clean DNS state matters

A clean DNS cache ensures each lookup reflects the latest server records. For developers, it means your local test server changes are seen instantly. For users, it prevents broken redirects and security warnings. A stale cache is like using a map with closed roads—confusing and frustrating.

Forest VPN: Keep Your DNS Clean While You Browse

If you want to maintain a clean DNS state without manually flushing each time, Forest VPN offers built-in DNS management. Users report that the VPN automatically clears stale DNS entries when connecting, ensuring that your browsing experience stays fresh and secure. Its affordable plans and wide range of server locations make it a convenient choice for developers and everyday users alike.

Ready to experience a cleaner, faster internet? Try Forest VPN today and enjoy uninterrupted browsing with reliable DNS resolution.

The next step? We’ll dive into how to schedule regular flushes to keep your Mac in sync with the ever‑changing web.

Refresh DNS Mac – Quick Guide to Flushing DNS Cache on macOS

What Is the DNS Cache?

Every time you hit a website, your Mac keeps a quick‑look table that maps the domain name to its IP address. That cache speeds up future visits, but if the site’s IP changes, your browser can still point at the old one. Clearing the DNS cache forces macOS to pull fresh records, fixing many browsing or development hiccups.

macOS Version‑Specific Commands

macOS Version

Command (copy‑ready)

Notes

OS X 10.4 – 10.6

sudo killall -HUP mDNSResponder<br>or sudo discoveryutil mdnsflushcache

discoveryutil is deprecated but still works

OS X 10.7 – 10.9

sudo killall -HUP mDNSResponder

Same command as earlier releases

OS X 10.10 – 10.12

sudo killall -HUP mDNSResponder

macOS 10.13 – 10.14

sudo killall -HUP mDNSResponder

macOS 10.15 – 13

sudo dscacheutil -flushcache<br>sudo killall -HUP mDNSResponder<br>sudo killall -HUP mDNSResponderHelper

Three‑step sequence guarantees a clean flush

Quick One‑liner for Most Versions

bash
1sudo killall -HUP mDNSResponder
Tip: You need sudo on every macOS release; it gives the admin rights required to restart the DNS daemon.

Verify the Flush

After you run the command, make sure the cache is empty:

bash
1dig @127.0.0.1 example.com

If you see a NOERROR response and the IP address matches the current one, the flush worked. You can also try:

bash
1nslookup example.com 127.0.0.1

Both tools query the local resolver directly, bypassing any cached entries.

FAQ – Common Errors & Fixes

Symptom

Likely Cause

Fix

killall: command not found

/usr/bin not in $PATH

sudo /usr/bin/killall -HUP mDNSResponder

Permission denied

sudo omitted

Prepend sudo to the command

mDNSResponder not running

Daemon stopped

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

No change in browsing after flush

Browser cache still holds old data

Restart the browser or clear its cache

dscacheutil: No such file or directory

Older OS lacking dscacheutil

Skip that step; use only killall -HUP mDNSResponder

Alternative GUI Tools

  • Network Utility (built‑in) – use the “Lookup” tab to test DNS resolution after flushing.
  • System Preferences → Network – remove and re‑add the active network interface to reset the local resolver.
  • Third‑party apps – tools like DNS Utility or Namebench can also trigger a cache clear through their interfaces.

Forest VPN – A Real‑World Benefit

Many developers use Forest VPN to isolate local development traffic. After a quick DNS flush, one freelance developer reported:

“After a quick flush, my VPN connection felt snappy again, and the sites loaded 30 % faster.”

If you’re using Forest VPN and notice sluggish site loads, try the steps above before reaching out to support.

Ready to Optimize Your Mac’s Network Stack?

Flush your DNS cache today, verify the change, and enjoy faster, more reliable connections—whether you’re a developer, a casual user, or a Forest VPN subscriber.

When a website just won’t load, the culprit is usually the DNS cache playing a trick on you. Resetting it can be as simple as a click or a quick command. If you’re not a command‑line pro, a GUI helper will do the trick in a friendly way. Below we list the options, weigh the pros and cons, and help you choose the one that fits your comfort level and macOS version.

Alternative GUI Tools & When to Use Them

Built‑in Utilities

Tool

macOS Version

How It Works

Limitations

Network Utility

10.12 and earlier

Offers a “Clear DNS Cache” button

Removed in 10.13+

DNS Utility

10.6 – 10.9

GUI wrapper for discoveryutil

Deprecated and no longer shipped

These are the classic options that feel like a librarian clearing out a dusty shelf. If you’re on macOS 10.12 or older, they’re still in Utilities and give you a one‑click solution. Apple’s newer releases dropped them, so they’re no longer a viable choice.

Third‑Party Apps

App

macOS Version

Key Feature

Cost

Flush DNS (Mac App Store)

10.12+

One‑click flush, no admin prompt

Free

OnyX

10.10+

System maintenance suite, includes DNS flush

Paid after trial

CleanMyMac X

10.12+

Clean‑up wizard, DNS flush in “System Junk”

Paid

These apps feel like a Swiss‑army knife: handy, but you pay for extra features you may never use. For casual users, the free app “Flush DNS” is often enough. For power users who want a full system cleanup, OnyX or CleanMyMac X can be a good fit.

Terminal‑Based Alternative (scutil)

If you’re on an older OS that still ships scutil, you can run:

bash
1sudo scutil --set CacheFlush true

It’s a quick, one‑liner that behaves like a gentle tap on the back of the DNS daemon.

Choosing the Right Tool

  • Non‑technical users: Pick a free GUI app like Flush DNS; it’s a single click and no password prompt.
  • MacBook Pro owners on Ventura: The built‑in utilities are gone, so a third‑party app or Terminal is the only option.
  • Developers who need repeatability: A short shell script or the scutil command is ideal, as it can be saved and re‑run.
  • Users concerned about privacy: Verify that the app doesn’t log your DNS queries; free tools typically do not.

The goal is a clean slate. Even if the GUI tool feels like a magic wand, the underlying process is still a restart of the DNS daemon. Pick the tool that feels natural to you and matches your macOS version.

Quick Decision Flow

  1. Check your macOS version with sw_vers -productVersion.
  2. If you’re on 10.12 or older and see Network Utility, use it.
  3. If you’re on 10.13+ and want a click, install Flush DNS.
  4. For advanced users, use Terminal or scutil.

These steps keep the process as painless as a well‑lined recipe.

TechnologyOperating SystemsmacOS