Forked from chriscrowe/docker-pihole-unbound
This repo runs Pi-Hole and Unbound in one container.
- This configuration contacts the DNS root servers directly, please read the Pi-Hole docs on Pi-hole as All-Around DNS Solution to understand what this means.
- With this approach,
macvlan
should no longer be necessary, but I prefer running Pi-Hole with its own IP address.
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.
First create a .env
file to substitute variables for your deployment.
Vars and descriptions replicated from the official pihole container:
Variable | Default | Value | Description |
---|---|---|---|
TZ |
UTC | <Timezone> |
Set your timezone to make sure logs rotate at local midnight instead of at UTC midnight. |
FTLCONF_webserver_api_password |
random | <Admin password> |
http://pi.hole/admin password. Run docker logs pihole | grep random to find your random pass. |
FTLCONF_LOCAL_IPV4 |
unset | <Host's IP> |
Set to your server's LAN IP, used by web block modes and lighttpd bind address. |
REV_SERVER |
false |
<"true"|"false"> |
Enable DNS conditional forwarding for device name resolution |
REV_SERVER_DOMAIN |
unset | Network Domain | If conditional forwarding is enabled, set the domain of the local network router |
REV_SERVER_TARGET |
unset | Router's IP | If conditional forwarding is enabled, set the IP of the local network router |
REV_SERVER_CIDR |
unset | Reverse DNS | If conditional forwarding is enabled, set the reverse DNS zone (e.g. 192.168.0.0/24 ) |
WEBTHEME |
default-light |
<"default-dark"|"default-darker"|"default-light"|"default-auto"|"lcars"> |
User interface theme to use. |
Example .env
file in the same directory as your docker-compose.yaml
file:
FTLCONF_LOCAL_IPV4=192.168.1.10
TZ=America/Los_Angeles
FTLCONF_webserver_api_password=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
PIHOLE_WEBPORT=80
WEBTHEME=default-light
docker-compose up -d
You can build your own image locally by cloning the repo and running the script build_and_push.sh (edit the tag accordingly) If VERSION is empty, the image will be based on the latest version of the base container. To use a specific version of the base container, specify it in VERSION.