Skip to content

Instantly share code, notes, and snippets.

@baraque
Forked from stevejenkins/Pi-hole on UC-CK 0.13.6
Created January 6, 2021 03:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save baraque/71eced2e5094c6a18e5ea99c243affed to your computer and use it in GitHub Desktop.
Save baraque/71eced2e5094c6a18e5ea99c243affed to your computer and use it in GitHub Desktop.
Pi-hole on UC-CK 0.13.6
# Instructions for installing Pi-hole 4.2 on UniFi CloudKey Gen 1 (UC-CK) running firmware 0.13.6
# Pi-hole will need to be completely re-installed after every FW update or if CloudKey is reset to defaults.
# Verify UC-CK is running firmware v0.13.6 (or later) before installing Pi-hole. If not, do:
ubnt-systool fwupdate https://dl.ubnt.com/unifi/stage/cloudkey/firmware/UCK/UCK.mtk7623.v0.13.6.7ad551e.190225.0939.bin
# UC-CK firmware v0.13.6 downgrades UniFi Controller to 5.10.17. Upgrade to 5.10.19 with:
cd /tmp
wget https://dl.ubnt.com/unifi/5.10.19/unifi_sysvinit_all.deb
dpkg -i unifi_sysvinit_all.deb
# All following commands will executed with sudo
sudo -i
# Update local package lists
apt-get update
# Install dnsmasq
apt-get install dnsmasq
# Downgrade to a specific 'libsqlite3-0' so Pi-hole script can install 'sqlite3'
apt-get install libsqlite3-0=3.8.7.1-1+deb8u4
# Install back-ported version of 'ifupdown' so Pi-hole script can install 'resolvconf'
apt-get install ifupdown=0.8.13~bpo8+1
# See that port 53 already in use by 'systemd-resolved'
netstat -plnt | grep :53
#Turn off local 'systemd-resolved'
sudo systemctl stop systemd-resolved
sudo systemctl disable systemd-resolved.service
# Download Pi-hole installation script and run locally
cd /tmp
wget -O basic-install.sh https://install.pi-hole.net
bash basic-install.sh
# During install, select 'eth0' for adapter, otherwise use all defaults
# Following install, set Pi-hole admin password
pihole -a -p
# Test Pi-hole DNS resolution -- resulting IP address(es) should be valid
dig @127.0.0.1 ui.com
# Test Pi-hole blocking -- resulting IP address should be '0.0.0.0'
dig @127.0.0.1 googleadservices.com
# Change Pi-hole web admin interface to port 81 (port 80 already used by UC-CK GUI)
sed -ie 's/= 80/= 81/g' /etc/lighttpd/lighttpd.conf
#Restart Pi-hole web admin interface
/etc/init.d/lighttpd restart
# Show Pi-hole chronometer (CTRL + C to exit)
pihole -c
# Go to http://ip.addr.of.cloudkey:81/admin/ to configure additional settings.
# OPTIONAL: UC-CK also supports these instructions for running unbound so your UC-CK can be an all-around DNS solution:
# https://docs.pi-hole.net/guides/unbound/
@baraque
Copy link
Author

baraque commented Jan 9, 2021

Install Pi-hole successfully in my Cloud Key.

Cloud Key Model: UC‑CK
Cloud Key Firmware Version: UCK v1.1.13
Controller Version: 6.0.43
OS: Debian GNU/Linux 8.11 (jessie)

A bit tweak compare to the above instruction

  • apt install libsqlite3-0=3.8.7.1-1+deb8u6
  • apt install ifupdown=0.7.53.1
  • Don't install web server as php5-xml installation failed in Debian 8
  • curl -sSL https://install.pi-hole.net | PIHOLE_SKIP_OS_CHECK=true sudo -E bash

@werlitong
Copy link

werlitong commented Jan 16, 2021

  • apt install libsqlite3-0=3.8.7.1-1+deb8u6

Thanks a lot. I'm on same controller and firmware version.

@werlitong
Copy link

  • Don't install web server as php5-xml installation failed in Debian 8

I'm getting this error. Can you say how to deal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment