
If you work on websites, you’ll occasionally need to reset your computer’s DNS cache, particularly after editing records or changing hosts. While flushing the DNS cache on Windows is easy with a dedicated command, Mac users have to use a bit of a workaround.
Clear Your DNS Cache on Your Mac
To clear your DNS cache on your Mac, open the Terminal, which you can find in Applications > Utilities or by searching with Spotlight, and then run the following command:
sudo killall -HUP mDNSResponder
Enter your password when it’s requested.
So, what does this command actually do? What’s happening here is that you’re kind of tricking your system into flushing the cache. Wikipedia explains:
The SIGHUP signal is sent to a process when its controlling terminal is closed. It was originally designed to notify the process of a serial line drop (a hangup). In modern systems, this signal usually means that the controlling pseudo or virtual terminal has been closed. Many daemons will reload their configuration files and reopen their logfiles instead of exiting when receiving this signal. nohup is a command to make a command ignore the signal.
Obviously you don’t need to know all of the rest of that. But now you do.
…
The post How to Reset the DNS Cache on macOS appeared first on FeedBox.