Dec 8, 2017 - The DNS (Domain Name System) cache is a temporary database. It includes recent records as well as attempted visits to websites along with. We’ll show you how to flush out DNS cache in MacOS Sierra 10.12 and later. Note: this uses the command line and thus is aimed at more advanced users. It’s fairly rare that a novice Mac OS user would need to reset their DNS cache anyway, but often just rebooting will achieve the same effect.
DNS, or a Domain Name System, is basically what resolves website names into their respective IP addresses. So, if you are encountering an issue on your Mac where the name server is not resolving properly, or if you want a DNS change to be noticed by your system, you might have to reset and flush the DNS cache in macOS Sierra. This can also come in handy, if you have made edits to your /etc/hosts file, and you want the changes to register without having to reboot your Mac.
So, if you want to reset and flush the DNS cache on your Mac, here is how to do it. Reset and Flush/Clear DNS Cache in macOS Sierra The procedure to reset and flush aka clear DNS cache in macOS is actually very easy. All it requires is for you to enter one command in the Terminal, and you’re done. Well, technically, it’s two commands in one line. If you want to flush DNS cache on a Mac, simply follow the steps below: 1.
Launch Terminal, and type “ sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder“. You will be prompted to enter a password. Enter your Mac login password here, and hit Enter. Great, you have successfully reset, and flushed the DNS cache on macOS Sierra. If you were encountering any issues with name servers, and such, they should now get resolved. You can try and do a “ dig“, or an “ nslookup” on a website you want, to see if your DNS issues have resolved.
Using dig to Check Query Times Often, if your DNS settings are messed up, or if you have a DNS that is simply too slow, you might be left wondering what is going on. To check whether your DNS is working fine, you can use the “dig” command in the Terminal: 1. Launch Terminal, and type “ dig beebom.com“. You can use the name for any website in place of beebom.com.
In the results, you can check the “ Query time“. If you find that the query time for the website is too high, you should change macOS’s DNS settings, and set a DNS server like Google DNS. Once you have changed the DNS server, you can run the dig command again, to check if there has been any improvement. Unless there is an issue with your ISP, changing DNS to Google DNS, or OpenDNS should really help.
Advertisement If you are a developer, you may understand the importance of resetting DNS cache. If you have changed the name servers of a domain, you need to flush the existing DNS cache. There could be more reasons why you need to reset or clear DNS cache. If you are using MacOS and do not know how to do it, here is the guide. In this article, I will tell you how to clear or reset DNS cache in MacOS High Sierra.
Also see: In MacOS High Sierra, you can reset the DNS cache by using the terminal app. You just need to follow these steps. Step 1: Launch the Terminal Application. Advertisement Step 2: At the command line, type the following command and hit enter sudo killall -HUP mDNSResponder; sleep 2; echo macOS DNS Cache Reset say Step 3: Wait a moment until it says “macOS DNS Cache Reset” appear in Terminal the DNS cache reset has been successful. Exit terminal.
Now relaunch the browser or any other app where you were testing something. Relaunch is necessary for the changes to take effect. Final Words As the heading of this article says, the above method is for macOS High Sierra. If you are on any other version of MacOS, you need to follow other Steps. Search on UseThisTip for older articles and you will get the result.