Quarantine has had me start to dink around with small side projects to keep busy and one of those projects has been to setup pi-hole adblock filtering on my network. What initiated the project was my Samsung smart TV which feeds ads as part of it’s navigation menu.
I don’t really know how computers work so setting up pi-hole to work how I wanted took a little bit of discovery. Here are the steps I took, starting with some steps grabbed from this forum thread:
- Log in to QNAP and run the Container Station app.
- If it’s not installed, install it from the app center
- Create an LXC Ubuntu container
- Name the image something sensible, like maybe pi-hole
- Limit the memory to 1024 and CPU to around 20%
- Under “Advanced Settings” change the network mode to bridge and select “Use Static IP”
- Once that’s created, head back to the overview tab in container station.
- Click on the new image to access the console
- Make sure to change the default password using the
passwd
command. The original password isubuntu
sudo apt-get update
sudo apt-get install -y openssh-server
sudo adduser piuser
sudo usermod -aG sudo piuser
Now you should be able to ssh aspiuser
on another terminal. I’ve recently been using windows terminal but I’ve previously used cmder- From the terminal run
ssh piuser@<static-ip>
for examplessh piuser@192.168.1.100
sudo su
sudo apt-get install curl
curl -sSL https://install.pi-hole.net | bash
- Select the defaults until the DNS screen and then choose Cloudflare
- Set your pihole password with
pihole -a -p
after returning to the terminal - Log in to pihole from a webprowser using the same ip from before http://192.168.1.100/admin for example
- Log in with the credentials you set in step 19.
At this point pihole should be “working” but I initially was not receiving an accurate client list, instead all clients would collapse to a single IP (my router). To fix this I needed to change some settings on my asus router. This was mostly stolen from here.
- Navigate to the wan tab and set up the following DNS settings
- Go to the lan tab and make sure you setup your DNS server to point at pihole’s static ip that was set up earlier.
- Back in pihole set up it’s DNS settings to forward requests to the router
That’s it! You should start seeing requests blocked in your pihole console.