Pi-Hole & Personal rDNS Server Appliance Setup Guide¶
Part 4: Make Pi-Hole work for you!¶
Overview¶
This guide will walk you through the steps necessary to install and configure a Pi-Hole on your Raspberry Pi, along with a personal recursive DNS server that will keep your DNS queries out of your ISP's immediate view.
The core sections of this guide are broken down into 4 parts:
- Installing the Raspberry Pi OS
- Installing the Pi-Hole Application
- Installing the recursive DNS Server
- Make Pi-Hole work for you! (you are here)
Background¶
In order to take full advantage of the Pi-Hole & rDNS appliance you just created, you have to tell your computer (and any other device you want to have access to the awesome ad-blocking power of Pi-Hole) to use the Pi-Hole as its primary DNS server.
Any time you access a website, not only does your browser use DNS to figure out what the IP address of the underlying webserver, but it also makes dozens of secondary lookups for 3rd party content on the pages that load. This could be useful content, but also ads and trackers. By using Pi-Hole as your DNS server, it has the ability to block any lookups that would result in loading ads or trackers, and as a result that resource never gets loaded on the page.
The instructions are based on the assumption that the devices on your home network receive IP address assignments via DHCP. There is usually more than one way to accomplish this task, so if you know of a different way, you can certainly use it.
Warning
We just established that having a reliable DNS server is critical to a functioning network, and that without DNS, most modern browsers will not function properly. Once you make your Pi-Hole is active in your network, and all devices rely on it for DNS, you have to make sure it remains powered and connected to the network. If the Pi accidentally loses power, or the network cable becomes unplugged, your connected devices will likely experience many network failures. It is strongly recommended to keep your WiFi router and Pi-Hole in close physical proximity, and use the same power strip or outlet to power them. That way, if one loses power, so does the other, and a failure will be obvious.
What follows are instructions for Windows 10 and MacOS. If you run Linux as your desktop OS, or if you assign your IP addresses manually, chances are you already know how to make the necessary changes.
Option 1: Manual Assignment of DNS Server¶
This is probably best for initial testing, or if you only plan on using your Pi-Hole for yourself, on one or two devices.
Windows 10¶
In a Powershell window, type ncpa.cpl and hit Enter.
Alternatively, click on the START button, click on Settings (gear cog icon on left sidebar), click on Network & Internet. This should bring you to the "Status" view. Scroll down and click on "Change adapter options."
In the window that opens, locate your network adapter. Most likely it will be named "Wi-Fi" and have your SSID listed just below that.
Right-click on the adapter icon, and select "Properties".
In the windows that opens, below "This connection uses the following items", look for "Internet Protocol Version 4" and double-click on it.
In the window that opens, leave "Obtain an IP address automatically" if it is already pre-selected, and select "Use the following DNS server addresses:" Enter the static IP address that you picked for your Pi-Hole.
Click OK on both open configuration windows and close the Network Connections window.
Mac OS¶
Click on the Apple Menu and select System Preferences.
Click Network.
From the list on the left, locate your network connection. Most likely it will be Wi-Fi.
Highlight it by single-clicking on it, and then click "Advanced" in the lower right areaof the window.
Select DNS from the top row, then click the "Add" (+) button at the bottom of the DNS Servers list. Enter Enter the static IP address that you picked for your Pi-Hole.
When you’re finished, click OK and close the Network Preferences.
This HowToGeek.com article is a few years old (20 Feb 2018), but still has some decent instructions for many more OSs (including mobile), and most importantly, screen shots: The Ultimate Guide to Changing Your DNS Server
Option 2a: Assignment of DNS Server by WiFi Router DHCP¶
How you accomplish this depends in lot on the make and model of WiFi router or Cable/DSL modem you use where you live.
Lifewire.com has a fairly comprehensive and reasonably up to date (14 Jul 2020) article that covers most popular router brands: How to Change DNS Servers on Most Popular Routers
The thing to remember is that the IP address that you want to specify in your router configuration is the static IP address you assigned to your Pi-Hole.
Option 2b: Use Pi-Hole as your DHCP Server¶
This option requires that you disable the integrated DHCP server that's running on your WiFi router or Cable/DSL Modem, and enable the DHCP Server running on your Pi-Hole.
Not all WiFi routers or Cable/DSL Modems support this, so you may not be able to turn off the built-in DHCP server. If that's the case, you are stuck with either Option 1 or 2a. You do not want to enable the DHCP Server on your Pi-Hole while the DHCP server on your WiFi router is still active - it will cause great confusion, and may "break" your network.
Before you disable the DHCP server on the device that's currently serving your DHCP leases, take note of the DHCP scope / lease range, and what your network gateway IP address is. You will need to enter those values into the Pi-Hole as you configure its DHCP server.
Bitdefender.com has a knowledgebase article describing how to disable the DHCP server that covers many of the common routers: Disable the DHCP server feature on my router
After you disabled the existing DHCP server, log into the Web Admin interface, and select Settings from the left side bar.
On the page that loads, select "DHCP" from the top menu.
Check the box next to "DHCP server enabled."
Fill in the DHCP lease range you gleaned from your WiFi router or Cable/DSL Modem in the fields below "Range of IP addresses to hand out".
Last but not least, fill in your network gateway IP address (likely your router's management IP address, usually ".1") in the field below "Router (gateway) IP address." The Advanced DHCP settings don't need to be changed to start with, you can always come back and tweak them as needed.
Make sure you scroll down and click the "Save" button on the very bottom right of the page!
The Pi-Hole DHCP server is now active and ready to hand out dynamic IP addresses. It may take some time until existing clients "find" the new DHCP server running on the Pi-Hole. You can expedite that process by rebooting / restarting those devices.
If everything works correctly, you should start seeing new DHCP leases appear in the lower part of the page, under "Currently active DHCP leases."
Enjoy your (mostly) ad free browsing experience powered by Pi-Hole!