This Docker runs Pi-hole and Unbound in a single container.
1.6K
This Docker runs Pi-hole and Unbound in a single container.
This is mostly to free up port 80/443 in the Host for later use.
This was tested only on a Raspberry Pi 4B under Ubuntu 20.04 LTS.
If you have the same setup then this may be helpful.
Googled for my case and found below.
Ubuntu: How To Free Up Port 53, Used By systemd-resolved
My /etc/systemd/resolved.conf is:
[Resolve]
#DNS=
#FallbackDNS=
#Domains=
#LLMNR=no
#MulticastDNS=no
#DNSSEC=no
#DNSOverTLS=no
#Cache=no-negative
DNSStubListener=no
#ReadEtcHosts=yes
In my case, needed to set my chosen nameserver in /etc/resolv.conf.
nameserver 208.67.222.222
nameserver 208.67.220.220
Check parameters in /etc/sysctl.conf
net.core.rmem_max=8388608
net.core.wmem_max=8388608
Add lines if missing. Update values only if lesser. Reboot to enable the new values.
You may run below to increase values without rebooting. But this will not be saved on reboot.
sysctl -w net.core.rmem_max=8388608
sysctl -w net.core.wmem_max=8388608
ssh to your Raspberry Pi as ubuntu and run the following:
git clone https://github.com/ayen8/pihole-unbound.git
For example:
cd pihole-unbound
vi .env
Add the following environment variables and provide appropriate values for your network.
Sample below.
ServerIP=10.0.0.9
HOSTNAME=pihole02
DOMAIN_NAME=home.lan
TZ=Asia/Manila
WEBPASSWORD=qwerty123
DNSSEC=false
REV_SERVER=true
REV_SERVER_DOMAIN=home.lan
REV_SERVER_TARGET=10.0.0.1
REV_SERVER_CIDR=10.0.0.0/8
The important environment variables are:
| Docker Environment Var. | Description |
|---|---|
ServerIP: <Host's IP> | Set to your Host server's Static IP address. |
TZ | Set your timezone. |
WEBPASSWORD | Your elected password to login to Pi-hole. |
REV_SERVER: <"true"|"false">Optional Default: "false" | Enable DNS conditional forwarding for device name resolution |
REV_SERVER_DOMAIN: <Network Domain>Optional | If conditional forwarding is enabled, set the domain of the local network router |
REV_SERVER_TARGET: <Router's IP>Optional | If conditional forwarding is enabled, set the IP of the local network router |
REV_SERVER_CIDR: <Reverse DNS>Optional | If conditional forwarding is enabled, set the reverse DNS zone (e.g. 192.168.0.0/24) |
Checkout the official pihole container for the complete environment variable definitions.
You should be in the
pihole-unbounddirectory which contains the.envanddocker-compose.yamlfiles.
docker build -t ayen8/pihole-unbound .
docker-compose up -d
Configure your computer DNS settings to point to Host ServerIP. For whole home setting, this needs to be configured in your router.
Go to the Pi-hole admin page at http://ServerIP:YourPort/admin
Test various websites to see if ads are removed.
Content type
Image
Digest
Size
130.7 MB
Last updated
about 5 years ago
docker pull ayen8/pihole-unbound