If you are a macOS user and have recently made changes to your DNS settings, then doing a flush, aka cleaning the DNS cache would be a good idea. But why is it important to clear DNS cache?
Well, simply because when your DNS is cached, nameservers or domain name may not resolve to the correct IP and may lead you to a cached website, or worst, it’ll be unable to establish a connection.
In this post, I will show you how to clear and reset DNS cache on your macOS Catalina (works for Mojave as well).
Let’s check it out.
A step-by-step guide and list of commands to clear DNS cache in in macOS. Read more
Launch Terminal app. You can do it swiftly by executing this keyboard shortcut Command + Space. Then type in Terminal, then hit Enter.
Copy the following command into Terminal, and hit Return.
sudo killall -HUP mDNSResponder; sleep 2;
Enter your macOS’s password, and hit Return again.
Quit Terminal by using the keyboard shortcut: Command + Q.
That’s it, simple as that. Your DNS cache should now be cleared.
Now, if you are using older versions of macOS, targeting the
mDNSResponder process using the above command may not work.
Check out this post for commands on clearing DNS cache on older versions of macOS.