Sky-Hole Revisited [Pi-Hole in a cloud VM for easy DNS-based ad-blocking]
I wrote about my adventures running a Pi-Hole in the cloud for DNS-based ad-blocking roughly a year ago. In the time since, I've happily used a Sky-Hole for all the devices and traffic at home. When updating my Sky-Hole virtual machine recently, I used a simpler approach than before and wanted to briefly document the new workflow.
For more context on why someone might want to use a DNS-based ad-blocker, please refer to the original post.
Installation
-
Create an Ubuntu Server virtual machine with your cloud provider of choice (such as Azure or AWS)
Note: Thanks to improvements by the Pi-Hole team, it's now able to run in the smallest virtual machine size
-
Connect via SSH and update the package database:
sudo apt-get update
-
Install Pi-Hole:
curl -L https://install.pi-hole.net | bash
Note: Running scripts directly from the internet is risky, so consider using the alternate install instead
-
Open the dnsmasq configuration file:
sudo nano /etc/dnsmasq.d/01-pihole.conf
-
Turn off logging by commenting-out the corresponding line:
#log-queries
-
Open the Pi-Hole configuration file:
sudo nano /etc/pihole/setupVars.conf
-
Update it to use an invalid address for blocked domains:
IPv4_address=0.0.0.0
-
Re-generate the block list:
sudo /opt/pihole/gravity.sh
-
Verify the block list looks reasonable:
cat /etc/pihole/gravity.list
-
Verify logging is off:
cat /var/log/pihole.log
-
Reboot to ensure everything loads successfully:
sudo reboot
-
Grant access to the virtual machine's public IP address by opening the relevant network ports (incoming UDP and TCP on port 53)
Don't forget
If you use a Pi-Hole regularly, please consider donating to the Pi-Hole project so the maintainers can continue developing and improving it.