Running Pi-Hole on a QNAP NAS with an Asus router

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:

  1. Log in to QNAP and run the Container Station app.
    • If it’s not installed, install it from the app center
  2. Create an LXC Ubuntu container
  1. Name the image something sensible, like maybe pi-hole
  2. Limit the memory to 1024 and CPU to around 20%
  3. Under “Advanced Settings” change the network mode to bridge and select “Use Static IP”
  1. Once that’s created, head back to the overview tab in container station.
  2. Click on the new image to access the console
  1. Make sure to change the default password using the passwd command. The original password is ubuntu
  2. sudo apt-get update
  3. sudo apt-get install -y openssh-server
  4. sudo adduser piuser
  5. sudo usermod -aG sudo piuser

    Now you should be able to ssh as piuser on another terminal. I’ve recently been using windows terminal but I’ve previously used cmder
  6. From the terminal run ssh piuser@<static-ip> for example ssh piuser@192.168.1.100
  7. sudo su
  8. sudo apt-get install curl
  9. curl -sSL https://install.pi-hole.net | bash
  10. Select the defaults until the DNS screen and then choose Cloudflare
  11. Set your pihole password with pihole -a -p after returning to the terminal
  12. Log in to pihole from a webprowser using the same ip from before http://192.168.1.100/admin for example
  13. 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.

  1. Navigate to the wan tab and set up the following DNS settings
  1. 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.
  1. Back in pihole set up it’s DNS settings to forward requests to the router
Pi Hole Advanced DNS Settings for Asus Merlin

That’s it! You should start seeing requests blocked in your pihole console.

Leave a Reply

Your email address will not be published. Required fields are marked *