Site icon ChrisWrites.com

Struggling to connect to certain websites? How to flush the DNS cache in High Sierra

The DNS (Domain Name Server) is responsible for converting numerical IP addresses into readable domains. If your DNS isn’t setup correctly, then your Mac may struggle to load any websites.

If you’ve encountering DNS lookup errors, or it seems to be taking much longer to access certain web domains, then it’s possible the problem may lay with your DNS cache. A corrupted DNS cache can prevent certain servers and domains from being resolved correctly, so you’ll need to clear your DNS cache before your Mac can load these websites properly.

You may also need to reset your local DNS cache if you’ve recently made changes to your DNS settings but those changes haven’t taken affect.

Before resetting your cache, just be aware that this process may temporarily interrupt your Internet connection, so avoid resetting the cache when performing actions that rely on a stable and reliable network connection, for example when you’re midway through downloading a large file, or chatting to someone on Skype.

Resetting your DNS cache from the Terminal

In High Sierra, you can reset the DNS cache by targeting the mDNSResponder process, using your Mac’s Terminal:

sudo killall -HUP mDNSResponder

If you’re not running macOS High Sierra, then you’ll need to use a different Terminal command.

For macOS versions 10.10.0–10.10.3, use the following:

sudo discoveryutil mdnsflushcache

For macOS versions 10.5–10.6, use the following:

sudo dscacheutil -flushcache

Deleting the regular cache

If you’re encountering strange behaviour when trying to access certain websites, then it may help to delete your regular Safari cache. This requires you to uncover Safari’s hidden ‘Develop’ menu, if you haven’t already:

Exit mobile version