How to Reset the DNS Cache in OS X

How to Reset the DNS Cache in OS X

Like all proper computing practices, browsing the web and using web-connected services works best when paired with regular maintanance. When most people experience issues with loading web pages, or glitchy website loading, they immediately think of clearing the browser cache. While that does the trick most of the time, it doesn’t always completely resolve loading issues. That’s because sometimes the problem lies a little bit deeper – with the DNS system.

Screen Shot 2013-02-26 at 8.57.47 PM

DNS, or Domain Name System, is the system that translates text-based URLs, such as, into an address that servers can understand so they bring you to the right place. If you’re having site loading or browsing issues that clearing your cache doesn’t fix, resetting your DNS cache should be the next step. Like all modern operating systems I am aware of, OS X includes a command to erase or “flush” your DNS cache, forcing your Mac to make a fresh attempt at resolving a web address.

Flushing your DNS cache on a Mac is extremely simple – it’s a matter of entering a simple command into Terminal.

For Macs running OS X 10.6 Snow Leopard or earlier, enter the following command into Terminal to clear your DNS cache:

sudo dscacheutil -flushcache

In OS X Lion, Apple changed the way that DNS requests are cached – so to clear your DNS cache in OS X 10.7 or later, you’ll need to use this command instead:

sudo killall -HUP mDNSResponder

That’s all there is to it! One quick terminal command later, and your DNS settings should once again return to the way they are meant to be.

For more helpful tips, check out our full collection of tutorials by visiting our How-To category!