Does your Mac seem to be running slower these days than it did when you got it, particularly on the internet? There may be some steps you can take to speed up your web browsing experience on your Mac. Today we’ll discuss your DNS.
Understanding DNS:
The Domain Name System (DNS) was invented so that people using the internet would not have to remember IP addresses for every server or website they want to visit, but can instead use a more human-friendly hostname. For example, the domain name www.apple.com actually points to a server with the IP address 17.149.160.49.
The easiest way to think about DNS is as a phonebook for the internet, where your computer quickly looks up a website domain name to find the IP address for that website’s server. There are many of these “phonebooks” around the globe (technically called DNS Servers) that your computer can use, all of which are continuously synchronized with each other.
Why it affects your browsing speed:
When you type in a domain name in your browser, your computer first finds a DNS server and then looks up the IP address for that domain name and your browser begins communicating with the server at that IP address to load the website. Usually these steps happen in a matter of milliseconds, but a little delay anywhere in this process can feel like your Mac is running slowly.
Setting a static DNS server:
By default, your Mac is set up to not look for any particular DNS server, but instead to dynamically find the one that’s closest to you. Sometimes, though, it is beneficial to set a static value for this server–particularly if you have a desktop Mac that is always connected to the same network. In this case, you can set up your Mac to always use your Internet Service Provider’s DNS server (which would be the closest DNS server to your home network). However, if you have a laptop that is often on different networks (at home, at the office, and at coffee shops, etc.), then you will want to either leave your DNS information blank (default) or add a public DNS server from a service like Google or OpenDNS.com.
Here’s how you can adjust these settings in your Network System Preferences:
1. Click the “Finder” icon in the dock.
2. Click the “Go” menu at the top of the screen.
3. Click “Applications.”
4. Double-click “System Preferences.”
5. Click “Network.”
6. Select the method you use to connect to the internet in the left column. (Usually Ethernet or Airport (Wi-Fi).) Then click “Advanced” in the lower-right part of the window.
7. Click the “DNS” tab.
If there is already a value under DNS Servers, then you may need to delete it (select it and click the “-” button below it), which results in a grayed-out number, which is the default setting.
If there is a grayed-out number, then you have the default settings. You can leave that as-is or add one or more static values, which you can get by calling your ISP or from one of the public DNS services mentioned above (8.8.8.8 and 4.2.2.2 are commonly used public DNS servers that I have used in the picture below). Simply click the “+” button and type in the server address you wish to add.
When finished, click “OK” then click “Apply” to save your new settings.
Cleaning your DNS Cache:
Your Mac takes additional steps to try to speed up your internet browsing experience by storing the DNS information that it finds from DNS servers about the websites that you visit, so that it doesn’t have to look it up from the DNS server every time you go to that site. It stores this information in its DNS Cache. Over time, however, this information changes for some websites, which means that your Mac may have information stored in its DNS cache that is now invalid. This invalid information can cause your browser to load some websites more slowly than you expect, even sites you visit all the time. When this happens you should try clearing your DNS cache.
To start anew and have your Mac store only the latest DNS information, you will need to clear your DNS Cache using the steps below:
1 Click the “Finder” icon in the dock.
2 Click the “Go” menu at the top of the screen.
3 Click “Utilities.”
4 Double-click “Terminal.”
5 Type “dscacheutil -flushcache” (without quotes), and then press “Return.” The DNS cache has been reset.
In Conclusion:
Bad DNS settings or invalid information in your DNS cache is a lot like an old GPS that hasn’t been updated with the latest road changes–it will probably eventually get you to where you want to go, but not without some aggravating delays and detours. For the fasted web experience, keep your DNS up to date so your Mac starts looking in the right direction, right away, every time.