Locahl
Get Locahl
DNSmacOS Tahoeflush DNShosts filelocal development

macOS Tahoe Flush DNS Cache Command

Clear DNS cache on macOS Tahoe 26 with the exact Terminal command, verification steps, browser cache checks and hosts file troubleshooting.

L

Locahl Team

·6 min read

Manage hosts files without the terminal

Locahl helps you manage environments visually on Windows, macOS, and Linux, with automatic DNS flush and backups.

Get Locahl€9.99

One-time payment

Need the macOS Tahoe flush DNS command? Open Terminal and run:

BASH
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder

This clears the local DNS cache and nudges mDNSResponder, the resolver service macOS uses for name resolution. Use it after changing /etc/hosts, switching DNS servers, testing a migration, or fixing a local domain that still points to an old IP.

Quick answer

For macOS Tahoe 26, the practical command is:

BASH
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder

Terminal will ask for your administrator password. Nothing appears while you type the password. If the command finishes without an error, the system DNS cache has been refreshed.

For older macOS versions, see the complete Mac flush DNS command by version guide.

When to flush DNS on Tahoe

Flush DNS when your Mac keeps resolving a hostname to the wrong address. The common developer cases are:

  • You edited /etc/hosts and the browser still opens the production site.
  • You changed a local domain from one project to another.
  • You moved a staging site to a new server before DNS propagation.
  • You changed DNS resolvers from your ISP to Cloudflare, Google DNS, NextDNS or a VPN resolver.
  • You fixed a typo in the hosts file but the old result still appears.

If the hostname was loaded in a browser recently, the system flush may not be enough. Browsers keep their own host cache.

Verify the resolved IP

After flushing DNS, verify what your Mac resolves:

BASH
dscacheutil -q host -a name myproject.test
ping myproject.test
dig myproject.test

Use dscacheutil to inspect macOS resolution, ping for a quick sanity check, and dig when you need DNS-server-level detail. If dig and dscacheutil disagree, check whether the hosts file or browser cache is overriding your expectation.

Tahoe hosts file checklist

If flushing DNS did not fix the problem, check the hosts file itself:

  • The file path is /etc/hosts.
  • Each active line starts with an IP address, then at least one space or tab, then the hostname.
  • Do not include https://, paths, ports or comments before the hostname.
  • Use .test for local development domains when possible.
  • Avoid .local unless you understand Bonjour and mDNS behavior.

Example:

TEXT
127.0.0.1 myproject.test
127.0.0.1 api.myproject.test
::1       myproject.test

If you need a refresher on syntax, read the /etc/hosts syntax guide.

Tahoe-specific notes for developers

macOS Tahoe keeps the same practical DNS flushing workflow used by recent macOS releases, but developers still hit problems because the stack has several caches.

System DNS cache

This is what dscacheutil and mDNSResponder handle. Flush it after hosts changes, DNS server changes and migration tests.

Browser DNS cache

Chrome and Firefox can keep their own host cache. If Terminal resolves the right IP but the browser does not, clear the browser layer.

Application cache

Some apps keep long-lived HTTP connections or internal resolver state. Restart Electron apps, database clients, API tools or browser dev servers if they keep hitting the old host.

VPN DNS

Corporate VPNs often push custom resolvers. If a local domain works off VPN and fails on VPN, check split DNS rules and proxy settings.

Test matrix

Use this matrix to isolate the problem:

  • dscacheutil -q host -a name myproject.test: macOS resolver.
  • ping myproject.test: quick IP check.
  • curl -I http://myproject.test: HTTP layer.
  • Chrome private window: browser state.
  • Another browser: browser-specific cache.
  • Phone hotspot: network-specific DNS.

If all command-line tests pass but Chrome fails, Chrome is stale. If command-line tests fail too, fix the hosts or DNS layer.

Common local-domain setups

Single app

TEXT
127.0.0.1 myproject.test
::1       myproject.test

API and frontend

TEXT
127.0.0.1 app.myproject.test
127.0.0.1 api.myproject.test
::1       app.myproject.test
::1       api.myproject.test

Migration preview

TEXT
203.0.113.50 example.com
203.0.113.50 www.example.com

Remove migration entries after the DNS change is complete.

Automation for frequent switching

If you change hosts entries every day, create a repeatable command:

BASH
alias flushdns="sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder && echo 'DNS cache flushed'"
alias checkhost="dscacheutil -q host -a name"

Then:

BASH
flushdns
checkhost myproject.test

For project-heavy workflows, a visual hosts manager avoids two common mistakes: saving malformed lines and forgetting to flush DNS. Locahl also makes it easier to keep temporary migration entries separate from permanent local domains.

What to document in project READMEs

Every local project should document:

  • Required local domains.
  • Required ports.
  • Whether HTTPS is mandatory.
  • mkcert command for certificates.
  • Whether Chrome DNS cache must be cleared after switching.
  • Any VPN or proxy requirement.

Example:

TEXT
Local app: https://app.myproject.test
Local API: https://api.myproject.test
Hosts: 127.0.0.1 app.myproject.test api.myproject.test
Certificate: mkcert app.myproject.test api.myproject.test
After hosts change: flushdns

Clear browser DNS cache too

Chrome:

  • Open chrome://net-internals/#dns.
  • Click "Clear host cache".
  • Restart Chrome if the error persists.

Firefox:

  • Open about:networking#dns.
  • Click "Clear DNS Cache".

Safari:

  • Enable the Develop menu.
  • Use Develop > Empty Caches.
  • Quit and reopen Safari if the stale result stays.

For a dedicated browser walkthrough, use the Chrome DNS cache guide for Mac.

Automate it

If you switch local projects often, add an alias:

BASH
alias flushdns="sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder && echo 'DNS cache flushed'"

Reload your shell:

BASH
source ~/.zshrc

Now you can type:

BASH
flushdns

Locahl automates this flow for hosts file changes: edit the mapping visually, save it, and the DNS flush happens as part of the workflow.

Troubleshooting

Password does not show while typing

That is normal Terminal behavior. Type your administrator password and press Enter.

"No matching processes were found"

Restart the resolver service:

BASH
sudo launchctl kickstart -k system/com.apple.mDNSResponder

Then run the flush command again.

The wrong site still opens

Work through this order:

  • Re-check /etc/hosts syntax.
  • Flush system DNS.
  • Clear browser DNS cache.
  • Disable VPN or proxy DNS temporarily.
  • Test in a private browser window.
  • Verify the server accepts the hostname.

Conclusion

On macOS Tahoe, DNS cache problems usually come from one of three places: stale system cache, stale browser cache, or a hosts file syntax issue. Start with the flush command, verify with dscacheutil, then clear browser DNS if needed.

Also readHow to edit the hosts file on Mac
Share this article
Available on Windows, macOS & Linux

Ready to simplify your workflow?

Stop wasting time with the terminal. Locahl lets you manage your hosts file in a few clicks, with automatic validation and no risk of errors.

  • Intuitive visual interface
  • Automatic DNS flush
  • Multi-environment management
  • Automatic backups
  • JSON Import/Export
Get Locahl€9.99One-time payment, no subscription

Frequently Asked Questions

What is the macOS Tahoe flush DNS command?

Run sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder in Terminal.

Does macOS Tahoe show a success message after flushing DNS?

No. Returning to the prompt without an error usually means the command completed.

Should I also clear Chrome DNS cache?

Yes, if the affected hostname was already loaded in Chrome. Use chrome://net-internals/#dns.

Related Articles

6 min read
hosts fileDNSlocal development

Hosts File: Location, Syntax and Uses (2026)

Learn what the hosts file does, where to find it on Mac, Windows and Linux, syntax examples, local dev uses and mistakes to avoid.

L

Locahl Team

6 min read
DNSmacOScache

Flush DNS Mac: macOS Cache Command (2026)

Copy the exact macOS flush DNS cache command for Tahoe, Sequoia, Sonoma, Ventura and older versions. Includes browser cache fixes.

L

Locahl Team

5 min read
ChromeDNSmacOS

Clear Chrome DNS Cache on Mac Fast

Clear Chrome DNS cache on Mac with chrome://net-internals, flush macOS DNS, restart sockets and fix stale local domains after hosts changes.

L

Locahl Team

Developer tools team

8 min read
Dockerhosts filemacOS

Using Hosts Files for Docker Development on Mac

Configure hosts files for Docker, docker-compose and container networking. Map services to local domains and simplify Mac development.

L

Locahl Team

11 min read
QA testingstaginghosts file

Hosts Files for QA and Staging Testing

Guide for QA teams testing staging environments before DNS propagation, with hosts file workflows and team collaboration tips.

L

Locahl Team