macOSLow

Clearing DNS Cache on macOS: Instructions for All Versions

In this guide, you'll learn how to properly clear the DNS cache on macOS using Terminal. This helps resolve website access issues after changing DNS or during name resolution errors.

Updated at February 16, 2026
5-10 min
Easy
FixPedia Team
Применимо к:macOS 10.10 and abovemacOS 11 Big SurmacOS 12 MontereymacOS 13 VenturamacOS 14 Sonoma

Introduction

DNS cache (Domain Name System Cache) is temporary storage where macOS saves the results of domain name resolution (e.g., example.com → IP address). This speeds up access to frequently visited websites. However, if DNS records change (for example, when a site is moved to a new server) or become invalid, the cache may contain outdated data, leading to "site not found" errors or connections to the wrong IP. Flushing the DNS cache forces the system to request up-to-date records from DNS servers, which often resolves network issues without requiring a reboot.

Requirements

Before following the instructions, ensure that:

  • You have macOS 10.10 (Yosemite) or newer installed. Commands differ for older versions (OS X 10.9 and earlier), but such systems are rarely used today.
  • You have a user account with administrator privileges (to use sudo).
  • You have access to Terminal (the built-in application).

Step-by-Step Instructions

Step 1: Open Terminal

Terminal is the macOS command line interface used to flush the cache. There are several ways to open it:

  • Press Cmd+Space (Spotlight), type Terminal, and press Enter.
  • Open the Utilities folder via Launchpad or Finder (Go → Go to Folder → /Utilities) and launch the Terminal application.

Step 2: Flush the DNS Cache

In the open Terminal, enter the following command and press Enter:

sudo killall -HUP mDNSResponder

What this command does:

  • sudo — executes the command with superuser privileges (an administrator password will be required).
  • killall — sends a signal to all processes with the specified name.
  • -HUP — the hangup signal (SIGHUP), which forces the process to reload its configuration and clear the cache.
  • mDNSResponder — the system daemon responsible for DNS name resolution in macOS starting with version 10.10.

After entering the command, the system will prompt for the administrator password. Type the password (characters are not displayed as you type) and press Enter. If the password is correct, the command will execute instantly and return the command prompt (e.g., MacBook-Pro:~ user$).

⚠️ Important: Ensure you type the command exactly as shown. Typos (e.g., mDNSresponder with a lowercase 'r') will result in a "No such process" message.

Step 3: Verify the Result

To confirm the DNS cache has been flushed, perform one of the following checks:

  1. Browser: Try opening a website that previously failed to load due to a DNS error (e.g., displayed "Could not find server").
  2. dig command (if installed, e.g., via Homebrew):
    dig example.com
    
    The ANSWER SECTION should display the current IP address. If you knew the old IP (e.g., from a previous check), compare it—it should have changed if the DNS record was updated.
  3. ping command:
    ping -c 4 example.com
    
    If packets are sent and replies are received (e.g., 64 bytes from 93.184.216.34), name resolution is working correctly.

💡 Tip: Some applications (Chrome, Firefox) have their own DNS caches. If the problem persists, close and reopen the browser or clear its cache in the settings.

Potential Issues

  • "No such process" error: This means the mDNSResponder process is not running. It is normally always active. Try restarting your Mac and repeating the command. If the issue continues, check if you are using third-party utilities that might stop system services.
  • Permission denied error: Ensure you are using sudo and entering the password correctly. Also, verify that your user account is part of the administrator group (System Settings → Users & Groups).
  • Issue not resolved after flushing: The problem might not be with the macOS cache but with network settings, DNS servers, or third-party software (firewalls, antivirus, AdGuard). Check DNS settings in System Settings → Network. Also, try restarting your router and running sudo ifconfig en0 down && sudo ifconfig en0 up (replace en0 with your network interface if necessary).
  • Command doesn't work on very old macOS versions: If you are on macOS 10.9 (Mavericks) or earlier, use the command sudo dscacheutil -flushcache. However, for modern versions (10.10 and later), sudo killall -HUP mDNSResponder is recommended.

F.A.Q.

Why do you need to clear the DNS cache on macOS?
What to do if the command sudo killall -HUP mDNSResponder didn't work?
Do you need to reboot your Mac after clearing the DNS cache?
How to verify that the DNS cache is cleared?

Hints

Open Terminal
Clear the DNS cache
Check network functionality
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community