Pi Hole

  • Download Raspbian Lite
  • Flash an SD Card with Pi image. https://www.balena.io/etcher/ has option for Linux and Windows.
  • Touch file /boot/ssh on SDCard to enable ssh for headless mode.
  • Boot to Pi
  • Grab the IP address with Nmap
$ nmap -p22 --open

Starting Nmap 7.60 ( https://nmap.org ) at 2019-01-20 17:21 AEST
Nmap scan report for raspberrypi (
Host is up (0.0031s latency).

22/tcp open  ssh

Nmap done: 256 IP addresses (5 hosts up) scanned in 2.44 seconds
  • ssh on to Pi
    • default username: pi
    • default password: raspberry
  • sudo apt update
  • sudo apt dist-upgrade
  • reboot
  • Change pi password
Install cloudflared

To optionally run Pi-hole using Cloudflare's DNS over HTTPS:

$ cd ~
$ wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-arm.tgz
$ sudo mkdir /opt/argo-tunnel
$ sudo tar -xvzf cloudflared-stable-linux-arm.tgz -C /opt/argo-tunnel
$ sudo cd /opt/argo-tunnel
$ /opt/cloudflared --version
Install PI Hole

I'm opting to download then run the script, rather than pipe it to bash with curl.

$ wget -O basic-install.sh https://install.pi-hole.net
sudo bash basic-install.sh

You will be prompted with the following during the installation. General defaults are fine, just be sure you select the correct interface.

  1. Choose Interface.
  2. Select upstream provider. ( I recommend Cloudflare if not using Cloudflared as above.)
  3. Select 3rd party lists for blocking ads.
  4. Select IPv4 and/or IPv6.
  5. Set static IP Address. I generally use the suggested, and make that reserved in my router config.
  6. Enable web interface.
  7. Enable web server.
  8. Enable log queries.
  9. Select privacy mode.

After that Pi-hole will install.

Post install cloudflared config

Update /etc/dnsmasq.d/01-pihole.conf:

# server=
# server=

Update /etc/pihole/setupVars.conf with:


Update /etc/systemd/system/dnsproxy.service with:

Description=CloudFlare DNS over HTTPS
After=network.target network-online.target
ExecStart=/opt/argo-tunnel/cloudflared proxy-dns --port 54 --upstream --upstream

Enable services & restart:

sudo systemctl enable dnsproxy.service
sudo systemctl restart dnsproxy.service

Test Cloudflared

$ dig @ -p 54 google.com

; <<>> DiG 9.10.3-P4-Raspbian <<>> @ -p 54 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 7136
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 4096
;google.com.			IN	A

google.com.		83	IN	A

;; Query time: 0 msec
;; WHEN: Fri Jan 25 02:32:24 GMT 2019
;; MSG SIZE  rcvd: 65
  • Configure router and/or devices to use Pi-hole as DNS server.
  • Access the admin console via, where that IP is the IP address of your Pi-hole, to view stats and manage whitelists.
  • To configure a little extra security, have a look at Pi Hard


Pi-hole Doco
Pi-hole DNS over HTTPS guide