How to Flush the DNS Cache in Mac OS X

Ben Stegner 13-09-2016

While so many preferences and tools are available on our computers these days, sometimes nothing beats a good old-fashioned command line tool 2 Networking Command Line Tools Everyone Should Know Every computer user, regardless of which operating system you use, should know these command line tools. Read More . This is especially important for networking information, no matter what operating system you’re on.


One of the most important systems on the Web is the Domain Name System, or DNS. This matches friendly website names to IP addresses, so when you go to your browser knows which IP address to request.

DNS usually works without a hitch, but since it’s cached, sometimes it can get stuck or point to an address that is outdated. When this happens, you might see DNS-related error messages pop up on every website you try to visit, or maybe just a few.

In Mac OS X, you can easily clear the DNS cache to get a fresh try in just a few quick steps. First, you’ll need to open a Terminal 4 Cool Things You Can Do With The Mac Terminal The Terminal is the Mac OS X analogue of the Windows command prompt, or CMD. It's a tool, as you probably already know, that allows you to control your computer using text commands, as opposed... Read More . The quickest way to do this is to press Command + Space to open Spotlight search. Type Terminal and press Return to launch a command line.

The command here differs slightly depending on which OS you’re running. Click the Apple logo in the upper-left corner of your screen and choose About This Mac to find out what version of OS X you have installed.

If you’re OS X Yosemite version 10.10.4 or newer (including El Capitan), the command is as follows:

sudo killall -HUP mDNSResponder

Running OS X Mavericks version v10.9.5 or earlier? The command you need is:

sudo killall -HUP mDNSResponder

Still running Snow Leopard? It’s probably time to upgrade your Mac 6 Signs It's Time to Replace Your Mac How long do Macs last? What are the signs that let you know when to get a new Mac? Here's when you should replace your Mac. Read More ! Until then, however, use this command:

sudo dscacheutil -flushcache

Clearing DNS can’t harm a thing, so don’t worry about misuse of this command. Give it a try next time you’re troubleshooting connection issues!

Do you ever have to clear DNS cache to resolve errors? Let us know how often you see this error in the comments!

Image Credit: argus via

Related topics: Computer Networks, DNS, Mac Tricks, Troubleshooting.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Deezy
    September 13, 2016 at 4:38 pm

    "sudo killall -HUP mDNSResponder"

    Didn't you specify this same command twice... Once for Mavericks and below, and once for Yosemite and above?