How Do I Reset My DNS on a Mac?
If you’re experiencing connectivity issues, you may be able to fix them by resetting the local record of domain name server (DNS) information stored on your Mac. This information may be outdated or corrupt, preventing websites from loading and slowing down your connection. To reset the DNS cache on a Mac, you need to enter a Terminal command on your Mac. Here’s how to flush your DNS cache on a Mac:
How to Flush DNS in Older Versions of macOS
Older versions of macOS use different Terminal commands to flush the DNS. However, you start by opening a Terminal window regardless of which macOS version you’re using. Here are the commands to flush DNS in each version of macOS:
El Capitan and newer: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderYosemite: sudo killall -HUP mDNSResponderLion, Mountain Lion, and Mavericks: sudo dscacheutil –flushcacheSnow Leopard: sudo lookupd –flushcacheTiger: lookupd –flushcache
What Does Flushing a DNS Do?
Whenever you try to access a website over the internet, you connect to a DNS server which tells your web browser where to go. The DNS server maintains a directory of websites and IP addresses, which allows it to look at the website address, find the corresponding IP, and provide it to your web browser. That information is then stored on your Mac in a DNS cache. When you try to access a website you’ve been to recently, your Mac uses its DNS cache instead of checking with an actual DNS server. That saves time, so the website loads faster. The web browser doesn’t have to go through the extra step of communicating with a remote DNS server, which results in less time between entering a website address and the website loading. If the local DNS cache is corrupt or outdated, it’s kind of like trying to use an old phone book or an address book someone has vandalized. Your web browser checks the cache to find an IP address for the website you’re trying to visit, and it finds either the wrong address or an unusable address. That can slow the process down or prevent websites or specific website elements, like videos, from loading. When you flush your DNS cache, you instruct your Mac to delete its local DNS records. That forces your web browser to check with an actual DNS server the next time you try to access a website. You should always flush your DNS cache after changing the DNS servers on your Mac. It can also be helpful if you’re having connectivity problems.