DNS

Flush the DNS cache on a Mac

macOS keeps DNS answers for some time. A flush removes them, so that the next lookup asks the DNS server again.

Applies to: OS X 10.10.4 Yosemite and later, which includes all current macOS versions.Checked: 29 October 2026

Symptoms

  • A site moved to a new server, but the Mac still goes to the old address.
  • A change to /etc/hosts or to a DNS record does not show.
  • A “server not found” error stays after the network works again.

Likely causes

  • Cached answers. mDNSResponder keeps a cache of DNS replies. The cache can hold an answer that is no longer correct.
  • The browser cache. Some browsers keep their own DNS cache. A macOS flush does not clear it.
  • The DNS server cache. The router or the provider also keeps answers. A flush on the Mac does not clear them.

How to check

  1. Ask the macOS resolver for the name. Compare the address with the address that you expect.

    dscacheutil -q host -a name example.com
  2. Show the DNS servers that macOS uses.

    scutil --dns

How to fix it

  1. Open Terminal. Clear the Directory Service cache.

    sudo dscacheutil -flushcache

    Needs an administrator password.

  2. Tell mDNSResponder to clear its cache. Apple gives this command for OS X 10.10.4 and later.

    sudo killall -HUP mDNSResponder

    Needs an administrator password.

  3. Type your password when Terminal asks. The commands show no message when they work.

  4. Quit and open the browser again, so that it does not use its own old answers.

  5. Look up the name again. If the old address comes back, the DNS server still has it.

With Kilobat

  1. The CLI runs the same two commands. macOS asks for an administrator password.

    kilobat dns flush
  2. In the app, open the Health tab and click Flush cache… in the DNS panel.

  3. The MCP tool set_dns with provider set to flush does the same. It tells the agent to ask you first.

Questions

Does a flush make DNS faster?

No. It removes old answers. The next lookups go to the DNS server again, so they can be a little slower.

Is it safe to flush the DNS cache?

Yes. macOS fills the cache again as apps look up names. The dscacheutil man page says to use its flush only when necessary.

Do I need to restart the Mac?

No. The commands take effect at once.

Sources

Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with man <name> in Terminal.