Summarize this article:

Click the Apple logo in the top-left corner of the screen. A drop-down menu will appear. It's in the drop-down menu. You'll find this option in the System Preferences window. Clicking it opens a new window. Click your current Wi-Fi connection in the left-hand sidebar. It's at the bottom of the window. Doing so will open yet another window. This tab is at the top of the window. It's in the bottom-left corner of the window. Do one of the following depending on whether you'd rather use OpenDNS or Google servers: Google Type 8.8.8.8 and press Return. OpenDNS Type 208.67.222.222 and press Return. Again, do one of the following depending on the address you initially chose: Google Type 8.8.4.4 and press Return. OpenDNS Type 208.67.220.220 and press Return. It's at the bottom of the window. This will save your DNS settings. This option is at the bottom of the window. Doing so applies your DNS settings to your network.

Summary:
Open the Apple menu . Click System Preferences. Click Network. Select your connection. Click Advanced. Click the DNS. Click +. Enter a primary DNS address. Click + again, then enter a secondary DNS address. Click OK. Click Apply.