The blog of
Archive: November, 2016
  • Sky-Hole Revisited [Pi-Hole in a cloud VM for easy DNS-based ad-blocking]
    Monday, November 21st 2016

    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.


    1. 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

    2. Connect via SSH and update the package database:

      sudo apt-get update

    3. Install Pi-Hole:

      curl -L | bash

      Note: Running scripts directly from the internet is risky, so consider using the alternate install instead

    4. Open the dnsmasq configuration file:

      sudo nano /etc/dnsmasq.d/01-pihole.conf

    5. Turn off logging by commenting-out the corresponding line:


    6. Open the Pi-Hole configuration file:

      sudo nano /etc/pihole/setupVars.conf

    7. Update it to use an invalid address for blocked domains:


    8. Re-generate the block list:

      sudo /opt/pihole/

    9. Verify the block list looks reasonable:

      cat /etc/pihole/gravity.list

    10. Verify logging is off:

      cat /var/log/pihole.log

    11. Reboot to ensure everything loads successfully:

      sudo reboot

    12. 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.

    Tags: Miscellaneous Technical Web