How to Change DNS Server Settings in Mac OS X
Having appropriate DNS settings is essential for a Mac to be able to successfully access internet domains, whether it be a website like https://osxdaily.com or a remote server. DNS, which stands for Domain Name Server, essentially translates numerical IP addresses to the readable domains that most internet users are familiar with, and thus without properly functioning DNS servers you often will encounter DNS lookup errors, or slower than expected access.
While most internet server providers offer their own DNS servers, and most Macs will use DNS from DHCP or a wi-fi router, Mac users sometimes wish to change DNS settings themselves to custom servers, perhaps for better performance, or for troubleshooting purposes. This is easily accomplished in MacOS and Mac OS X as we’ll detail in this walkthrough.
Adding, Editing, & Adjusting DNS Server Settings in Mac OS X
- Go to the Apple menu and select “System Preferences”
- Choose the “Network” control panel, select your network interface from the left side (“Wi-Fi” or “Ethernet” for example), then click the “Advanced” button in the lower right corner of the Network window
- Choose the “DNS” tab at the top of the screen
- To add a new DNS server: click on the [+] plus button
- To edit an existing DNS server: click twice on the DNS IP address you wish to change
- To remove a DNS server: select a DNS server IP address and then click either the [-] minus button or hit the delete key
The topmost DNS servers will be accessed first, so you’ll want to put the best performing servers near the top of the list for best results. In the screen shot examples above, Google DNS servers (184.108.40.206 and 220.127.116.11) are placed above the OpenDNS servers, both of which are faster than ISP provided DNS servers as determined by NameBench for this network environment.
Depending on what you’re doing and why you’re modifying DNS settings, you may wish to flush DNS cache for the changes to take effect, this is particularly true with editing the hosts file. Mac users can clear DNS caches in OS X El Capitan and newer with this command, and for specific Yosemite versions with this command, and even earlier releases of OS X with this. Additionally, you may need to quit and relaunch some applications for the DNS changes to carry over to them.
Advanced Mac users can also adjust DNS from the command line in Mac OS X, though that approach is obviously a bit more technical than simply changing the settings through the Network preference panel. And of course, those on the mobile side of things can change DNS in iOS as well if need be.