The Need for a DNS Flush
Whenever you type a website address like “digitash.com” into Safari, your Mac reaches out to a Domain Name System (DNS) server to translate that human-readable name into a machine-readable IP address. To speed up future browsing, macOS caches (saves) this IP address locally.
However, if a website recently migrated to a new server, changed its hosting provider, or suffered a DNS routing error, your Mac might stubbornly hold onto the old IP address. This results in the website failing to load, even when you know the site is online. The solution is to force macOS to delete its saved records by flushing the DNS cache, forcing it to fetch the fresh, updated IP addresses.
Step 1: Open the Terminal
macOS does not have a graphical button in System Settings to clear the DNS cache. You must use the command line.
- Press Command + Space to open Spotlight Search.
- Type
Terminaland hit Enter. - Alternatively, navigate to Applications > Utilities > Terminal.
Step 2: Use the dscacheutil Command
On modern versions of macOS (including Sonoma, Ventura, Monterey, and Big Sur), Apple uses a unified background daemon called mDNSResponder to handle DNS, alongside a utility called dscacheutil (Directory Service Cache Utility) to manage directory and name caches.
To successfully flush the DNS, you must run a combined command that clears the directory cache and restarts the DNS responder. Type the following exactly as written into the Terminal:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Breaking down the command:
- sudo: Executes the command with Superuser (administrator) privileges.
- dscacheutil -flushcache: Flushes the directory service cache.
- ;: The semicolon allows you to string two completely separate commands together on a single line.
- killall -HUP mDNSResponder: Sends a “Hang Up” (HUP) signal to the mDNSResponder process, which forces it to restart and clear its internal cache without crashing the system.
Step 3: Enter Your Password
Because you used the sudo command, macOS will prompt you to enter your administrator password.
As you type your password, no characters (not even asterisks) will appear on the screen. This is a standard Unix security feature. Simply type the password blindly and press Enter.
The Terminal will not output a “Success” message; it will simply return to a new blank prompt line. This indicates the command executed perfectly.
Step 4: Verify the Fix
Once the command is executed, close the Terminal. You should also completely quit out of your web browser (Safari or Chrome) by pressing Command + Q, and then reopen it. Attempt to navigate to the problematic website. Your Mac will now fetch the correct, updated DNS records from your ISP, and the site should load normally.