This tutorial will walk you through installing and setting up pihole, configuring blocklists, and setting your router to use pihole for DNS requests.

What is PiHole?

PiHole is a local DNS server and blacklist device that you can use on your local network to manage DNS, block ads and marketing trackers, and other specific websites. You can get information about PiHole on the website at: https://pi-hole.net/

Prerequisites

You will need to be able to get Rasperian Lite installed on your Raspberry Pi. I will not cover that step in this video and article. You will need to know how to adjust the DNS setting in your router. I am using a Linksys E1000 in this video. Most Linksys routers will be similar. Consult the user manual for your router.

Materials

You will need a Raspberry Pi. I would use one with a networking card onboard, though this tutorial is using a Pi Zero which needs a networking adapter. You will need the ability to attach a screen, Keyboard, and maybe a mouse to your Rasperry Pi for the initial setup. Once it is all setup, you will no longer need the screen, mouse, or keyboard.

Setup

Boot the Raspberry Pi into a terminal with Internet connection and type this into the terminal:

curl -sSL https://install.pi-hole.net | bash

Once the install script is running, you will have the blue setup screen. In this screen, use the space bar to select / deselect options and the tab to move between the options and the OK / cancel sections.

  1. Push OK through the first few informational screens.
  2. You will have the option to set your DNS provider. I personally like Quad9, but there are other options, you can choose your own settings here.
  3. Next screen is the Blocklists. You can select or deselect as many as you like. By default, they are all selected. You can add or remove these later through the web interface.
  4. Next is the choice IPv4 / IPv6. I keep both enabled, that is generally the best thing to do.
  5. Next screen is the IP selection screen. If you are setting this up on your router, you will be able to just keep the default, BUT you will want to assign that IP address to your pi with the Static Reserves in your router (this assures that this is the only device that can be assigned this IP address.)
  6. Next screen is the Web Admin Interface. This is important as it will allow you to control the PiHole settings from a website on your local network. If you do not use this setting, all configuration will need to be done in the terminal.
  7. The next setting to whether or not to log queries. This is completely dependent on your use case. Since I am the only one in my office, I generally keep this setting off. In a business or family setting, you might want it on, particularly if you are monitoring kids activity. This one is totally your call.
  8. The next screen is the FTL. This setting (at the time of this recording) is broken on Debian 10 (BUSTER), so if you select anything except 4-Disabled Statistics, I was getting a failure to install and a brick of the Pi...select option 4 here until we know it is fixed!
  9. Now let the installer do the rest.

Once the install is finished, we need to record the IP address and login info. The password is listed on the screen. You can change the password for the admin login on the terminal:

sudo pihole -a -p

Miscellaneous Configurations

There are a lot of little things that I would do to get the system ready, so we will walk through those now. We will be using the raspberry configuration settings to make the first round of changes:

sudo raspi-config

1 Change User Password: This is the password for the Pi (NOT the web admin). The username is pi. The default password is raspberry but that should be changed. Do it here. 3 Boot Options: I enable the autologin boot into the CLI. This way I know everything is setup and running without any issues if there is a power outage. 5 Interfacing Options: Enable SSH This will enable you to manage any adjustments to your pihole system without needing to attach a monitor and keyboard to your pi. The SSH server is disabled by default. Select Finish and reboot if you need to.

Change the IP address:

If you need to change the static IP address of your PiHole, you need to edit the hccpcd config file:

sudo nano /etc/dhcpcd.conf

The options are on the bottom of the file:

static ip_address={your new ip}
static routers={your new router dhcp server}

The Web Admin

Login to the admin console with the ip address /admin:

192.168.1.54/admin #Your IP address may differ

Login to the system with your webadmin password. The webadmin panel is very self-explanatory.

  • Whitelist: Allows a website through even if it appears on a blacklist
  • Blacklist: Allows single websites to be added to the block list
  • Settings → Blocklists: These are text lists of domains that will be blocked. You can add any Internet-available list and it will add those to the blocklist.
  • Settings → DNS: Allows you to change your DNS providers
  • Settings → DHCP: Allows the PiHole to be your IP address server (in place of your router – I usually leave this off)

Router Setup

Attaching your router to PiHole is a simple matter of changing your DNS settings for your router from the defaults to point to the IP address of your PiHole, in this example, 192.168.1.54. Reboot the router and your computer should now be running all DNS requests through the PiHole.

Firefox Canary:

http://use-application-dns.net/ Blocking this domain should prevent Firefox from enabling DoH