Sign inSign up

solidus1983/pihole-unbound

By solidus1983

•Updated about 4 years ago

Pihole Docker Container with Unbound

Image
1

624

solidus1983/pihole-unbound repository overview

⁠Pi-Hole + Unbound + Cron

⁠Description

This Docker deployment runs both Pi-Hole and Unbound in a single container.

The base image for the container is the official Pi-Hole container⁠, with an extra build step added to install the Unbound resolver directly into to the container based on instructions provided directly by the Pi-Hole team⁠.

Based off https://github.com/chriscrowe/docker-pihole-unbound⁠ 1 Container.

Also includes crontab to run pihole -g && pihole restartdns every day at Midnight.

⁠Usage

First create a .env file to substitute variables for your deployment.

⁠Required environment variables

Vars and descriptions replicated from the official pihole container⁠:

Docker Environment VarDescription
ServerIP: <Host's IP>
--net=host mode requires Set to your server's LAN IP, used by web block modes and lighttpd bind address
TZ: <Timezone>
Set your timezone⁠ to make sure logs rotate at local midnight instead of at UTC midnight.
WEBPASSWORD: <Admin password>
http://pi.hole/admin⁠ password. Run docker logs pihole | grep random to find your random pass.
REV_SERVER: <"true"|"false">
Enable DNS conditional forwarding for device name resolution
REV_SERVER_DOMAIN: <Network Domain>
If conditional forwarding is enabled, set the domain of the local network router
REV_SERVER_TARGET: <Router's IP>
If conditional forwarding is enabled, set the IP of the local network router
REV_SERVER_CIDR: <Reverse DNS>
If conditional forwarding is enabled, set the reverse DNS zone (e.g. 192.168.0.0/24)

Example .env file in the same directory as your docker-compose.yaml file:

ServerIP=192.168.1.10
TZ=America/Los_Angeles
WEBPASSWORD=QWERTY123456asdfASDF
REV_SERVER=true
REV_SERVER_DOMAIN=local
REV_SERVER_TARGET=192.168.1.1
REV_SERVER_CIDR=192.168.0.0/16
HOSTNAME=pihole
DOMAIN_NAME=pihole.local
⁠Using Portainer stacks?

Portainer stacks are a little weird and don't want you to declare your named volumes, so remove this block from the top of the docker-compose.yaml file before copy/pasting into Portainer's stack editor:

volumes:
  etc_pihole-unbound:
  etc_pihole_dnsmasq-unbound:
⁠Running the stack
docker-compose up -d

If using Portainer, just paste the docker-compose.yaml contents into the stack config and add your environment variables directly in the UI.

Tag summary

Content type

Image

Digest

sha256:c571f31e8…

Size

141.2 MB

Last updated

about 4 years ago

docker pull solidus1983/pihole-unbound:2022.07.1