Lets face it, ads can be annoying. You can install ad blockers on all of your devices, but what if there was a better way? With this Raspberry PI project, you can block adds on all devices. You can also have more control over your DNS. Today we will be using a Raspberry Pi package called Pi-Hole
- Head to the Raspberry Pi site and download Raspbian Buster with desktop
- Burn the image to a blank micro SD card using etcher.io
- Now put the SD Card into your Pi and boot it up. Connect to wifi or Ethernet
- Next open a terminal and enter the following command curl -sSL https://install.pi-hole.net | bash
- Press Ok through the first few menus, then on the network page select if you are using Wifi (wlan0) or Ethernet (eth0)
- Select your upstream provider, this is where dns requests will be sent. I am going to use google, but you could use cloudflare for Secured DNS
- Now you can select the lists to use in order to block adds, i am going to leave this default
- Next select the IP Protocol, I am going to leave this default
- Next confirm your gateway and static IP, it is best the change the IP to something outside your IP range or a high address. I am going to set mine as 10.0.0.2 because my router starts its pool at 10.0.0.20. Leave the gateway as is
- Select yes to install the Web Interface
- Select yes to install the Web Server
- Select Show Everything for privacy mode
- Now Pi-Hole is installed and ready to use
There a two ways to use the Pi-Hole with your devices. You can set the DNS server on each device (all devices are different, google your specific device to find out how to change DNS settings), or you can set the DNS server on your router. The second method will make every device in your network use the Pi-Hole.
To do this, log into your router and find the Internet or WAN section. From there you can enter the Pi-Hole’s IP as the DNS server and add a second for backup. I use 188.8.131.52 as the backup (Google). This is from my Netgear Router.
The Web UI
I really like the web interface to the Pi-Hole. You can monitor everything and see how many requests are being blocked. You can also blacklist and white list custom sites. You can also disable the Pi-Hole for a set time if needed. You can even check which devices are making the requests.