Pihole on the Beagle Bone Black


  • piholeonblack
  • Jonathan Haack
  • Haack’s Networking
  • netcmnd@jonathanhaack.com

//piholeonblack//


This tutorial instructs users on how to get a vanilla pihole instance functioning on the Beagle Bone Black. Please remember that my blog posts age, but my original Wiki post for this will receive updates as software/distributions/configurations change etc. Also, I don’t cover why to install a DNS sinkhole in this post, but you can read up on some others’ thoughts here:

The first step is to update/upgrade, then remove the files in /opt/ which are not required, and lastly to remove the software that will conflict with the pihole software and that is installed by default by BBB. (Do not remove anything starting with bb- as that is firmware needed for the device to work properly – believe me, I have tried.) Save removal of connman for after pihole installation takes over DNS. Here is what I do in order:

sudo apt update
sudo apt upgrade
sudo rm -rf /opt/*
sudo reboot
sudo apt remove --purge nginx* nodejs* apache2*
sudo apt autoremove
sudo apt autoclean
sudo reboot

Shell back in to the fresh system without clutter, and now run the installation script provided by pihole. Certainly look over the code first and/or visit their website for the latest script.

sudo -i
curl -sSL https://install.pi-hole.net | bash

Once it completes, it will fail to start pihole-FTL.service. The first reason is because the native dnsmasq configuration is conflicting with the re-write of dnsmasq that is provided by the pihole package. To get rid of this error, instruct the device to not use the default generated dnsmasq, create a leasefile for pihole to use with proper permissions, and remove two conflicting lines from the stock dnsmasq configuration (cache/leasefile) that the pihole software will conflict with (these conflicts can be verified in logs on pihole GUI). I typically reboot once more after these changes, just to make sure it comes back online, etc., but you will still not be in the clear.

sudo nano /etc/default/bb-wl18xx
USE_GENERATED_DNSMASQ=no
rm /var/lib/misc/dnsmasq.leases
touch /var/lib/misc/dnsmasq.leases
chown pihole:pihole /var/lib/misc/dnsmasq.leases
sudo nano /etc/dnsmasq.d/SoftAp0
#cache-size=2048
#dhcp-leasefile=/var/run/dnsmasq.leases
sudo reboot

The next problem is that the Beagle Bone Black’s network manager, connman, which is controlling both DNS/DHCP, is still installed and is starting on port 53 prior to the pihole-FTL.service, thus the pihole cannot start managing DNS since the port is already in use. However, the pihole is now ready to take over DNS and the DHCP client settings for the device itself (not to be confused with using as a DHCP server). Thus, it is now safe to remove connman without having to configure /etc/interfaces or do anything else to dnsmasq since pihole will take care of both henceforward.

sudo apt remove --purge connman
sudo reboot

More than likely, the Beagle Bone Black will hang at around 20/30% of the removal, since it will have lost its dhcp client reservation. Personally, I always have serial connected just in case, but if not, wait 3-4 minutes and then unplug and plug the device back in, and connman will be removed, and pihole-FTL.service will now be able to start and listen on port 53 and manage DNS requests, and the pihole will configure the device properly as a dhcp client underneath your router. From here, go to the GUI and all should be working.

Thanks to Freedom to Play for getting me started with this and to Jared from ABQ GLUG for the idea to tinker with pihole.

4 thoughts on “Pihole on the Beagle Bone Black

  1. Thank You.
    By following your instructions in detail, I have managed to get Pi-Hole working properly on a BeagleBone Black in Debian.

    I could not have easily done this without your excellent documentation of each and every step required.

    1. Noice! Yeah, a local in our IRC #nmglug, and I were looking at their install script and when he mentioned the dnsmasq portions, I combined that insight with the other tutorials I saw to figure out what was stopping it from working … basically a connman conflict with dnsmasq … it took about a month or two to get the recipe right! Glad it worked!

  2. Hello again,
    Just wanted to mention that I purchased a BeagleBone Green to use with the Pi-Hole because I felt the Wifi and Bluetooth were being wasted on the BeagleBone Black in this application.

    You procedure worked equally well on the BeagleBone Green and it did on the Black.

  3. Cool! Yes, one step covered in the wiki but not here is that all my traffic, whether wifi-based or otherwise is routed through the pihole for DNS. I personally do not desire the pihole to dual-function as my dhcp server, nor do I want it public facing like others do. I use an openWRT router and I set it up as follows ( https://wiki.haacksnetworking.com/lib/exe/fetch.php?media=computing:openwrt.png ) so that all devices on my lan use the pihole for DNS queries. People will desire different things for sure, and that’s why I like this recipe as it gives folks a vanilla instance of pihole on very good Beagle Bone hardware, and then they can do what they want! Enjoy and thanks for the feedback.

Leave a Reply to Loopy Byteloose Cancel reply

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

Close
%d bloggers like this: