Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Installation

Disable Systemd-Resolved

In order to free up port 53, you may need to disable systemd-resolved. 


sudo su

systemctl stop systemd-resolved
systemctl disable systemd-resolved


Start up Docker Container

We will run pi-hole in docker.

...

Code Block
CONTAINER=pihole
IMAGE=pihole/pihole:latest
DIR=`pwd -P`

docker stop $CONTAINER
docker rm $CONTAINER

# Note: ServerIP should be replaced with your external ip.
docker run -d \
    --name $CONTAINER \
    -p 53:53/tcp -p 53:53/udp \
    -p 8080:80 \
    --dns=127.0.0.1 --dns=8.8.8.8 \
    -v $DIR/data/pihole/:/etc/pihole/ \
    -v $DIR/data/dnsmasq.d/:/etc/dnsmasq.d/ \
    --restart=unless-stopped \
    --hostname pi.hole \
    -e TZ="America/Toronto" \
    -e VIRTUAL_HOST="pi.hole" \
    -e PROXY_LOCATION="pi.hole" \
    -e ServerIP="192.168.1.xx" \
    -e WEBPASSWORD="xxx" \
    --cap-add NET_ADMIN \
    $IMAGE

docker logs -f $CONTAINER

Setup


Configure Router to use pi-hole DNS server

Specify the pi-hole IP address in the list of DNS servers on your router.

...