When you are using WiFi or wired network using home broadband or mobile hotspot, you are assigned a default DNS server. It sometimes may be slow. It may be better to add few DNS server as backup DNS server in you Wifi or wired network interface. Here are quick steps to add Google public DNS servers (8.8.8.8 and 8.8.4.4) to Wi-Fi network interface on Mac:
-
First open the Network preferences by clicking on Wifi icon on top menu toolbar and then clicking on “open network preferences” sub menu as shown below:
-
Select the WiFi interface in left pane and then click on advanced settings button as shown below:
-
Click on DNS tab to Select DNS settings. Then click on plus icon as shown below to add more DNS server.
-
Add public Google DNS servers (8.8.8.8 and 8.8.4.4) after the already existing DNS server. Note that the order of these DNS servers does matter and it is better to keep the new DNS servers after the already existing servers. You can also use minus icon to remove the unwanted DNS server later if needed. You can also optionally change the order of these DNS servers by dragging the DNS IP addresses in UI.
- Once IP addresses are entered, click ok and then click Apply button to ensure changes are applied.
-
Run to following command to list the DNS servers set on you machine.
$ cat /etc/resolv.conf # # Mac OS X Notice # # This file is not used by the host name and address resolution # or the DNS query routing mechanisms used by most processes on # this Mac OS X system. # # This file is automatically generated. # nameserver 202.56.230.5 nameserver 8.8.8.8 nameserver 8.8.4.4
Note the presence of entries 8.8.8.8 and 8.8.4.4.