Pi Hole on QNAP Container

UPDATE!

Wanted to share how I built my Pi Hole container on a QNAP NAS where my DHCP server is on my home network router (Ubiquiti) and not in the Qnap.

Pi-Hole on a Qnap NAS using Container Station

  1. Open Container Station in Qnap
  2. Click on create in left menu
  3. Enter “Pi hole” in search bar and select the “Official Pi Hole Docker”.
  4. Once the image downloads, create a new container from the image.
  5. Adjust the CPU Limit and Memory Limit accordingly.
  6. Click the advanced settings link and under “Network” create a Container Mac address (any mac will work). * Create your own or use a mac address generator service (MAC address generator | MAC Address Vendor Lookup 590 ). The only way I could get the static IP to stick in my router was to create a hard mac address as without, the container will random generate a new mac address with every reboot.
  7. Change the Network Mode: to “Bridged”; select the correct Interface for the QNAP network; and select “use DHCP”.
  8. I had a hard time getting static IP to work within the Qnap, as I do not/not use my QNAP as the DHCP server. My DCHP server is on my home router.
  9. Click “Create”. The new container should start up on its own.
  10. Go to the “Overview” tab in Container Station and click the “Open Link” icon (chain link). This will open a new tab in your browser using the IP address of your new Pi Hole container.
  11. To create a new password for Pi Hole; go back to the “Overview” tab in Container Station and click the “Terminal” icon. When the run command pop up box opens, enter “pihole -a -p” (no quotes) . This will open a new tab and it will prompt you to enter a new password twice.
  12. Go back to the tab that opened in your browser for the pi hole admin panel and try the new password.
  13. To set the Pi Hole IP to static: Log into your Home router and find the IP/mac address for the newly created Pi Hole container and set the mac to static IP.
  14. You now will be able to use the Pi Hole address as your DNS server for Pi Hole features.

source: https://discourse.pi-hole.net/t/pi-hole-docker-container-on-qnap-nas/34278

QNAP LXD containter static IP: /etc/netplan/10-lxc.yaml

source: https://forum.qnap.com/viewtopic.php?t=147501

sudo apt-get update
sudo apt-get install -y openssh-server
sudo adduser piuser
sudo usermod -aG sudo piuser
sudo su
sudo apt-get install curl
curl -sSL https://install.pi-hole.net | bash
pihole -a -p