The issue I am facing:
So basically i want to run pihole together with unbound in a docker container. Maybe also using a macvlan if i had to do this in order to get it working. In the end i also want to use phiole as an dhcp server.
Running pihole itself in a docker container is pretty simple. But dhcp is not working - i think it's all about network issues and network settings with docker, etc.
So far so not good. This is my docker-compose
file:
version: '2'
volumes:
pihole:
dnsmasq:
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
#ports:
# - "53:53/tcp"
# - "53:53/udp"
# - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
# - "81:80/tcp"
cap_add:
- NET_ADMIN
environment:
ServerIP: ${ServerIP}
WEB_PORT: 81
WEBPASSWORD: ${WEBPASSWORD}
TZ: 'Europe/Berlin'
DNS1: 127.0.0.1#5335 # Hardcoded to our Unbound server
DNS2: 127.0.0.1#5335 # Hardcoded to our Unbound server
volumes:
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
dns:
- '127.0.0.1'
- '1.1.1.1'
network_mode: host
restart: unless-stopped
unbound:
image: klutchell/unbound:1.13.2
ports:
- '5053:5053/tcp'
- '5053:5053/udp'
restart: unless-stopped
Some configurations are stored inside a .env
file:
ServerIP=192.168.178.34
WEBPASSWORD=nope
REV_SERVER=true
REV_SERVER_DOMAIN=local
DOMAIN_NAME=pihole.local
I tried something with network_mode: host
so i had to uncomment some port
lines.
This is building a working pihole container. I also think unbound should work. Well, docker ps -a
tells me, unbound is running, so i guess its working.
Now i try to change some settings in my fritzbox 6591 cable router. If i only change dns to the address of my pihole, it's working pretty much. But the hostnames are wrong (router name instead of device name - the classic "issue" with pihole. The internet is full of post with this stuff). So to get rid of this problem, i thought about using my pihole also as a dhcp server. This should work i guess.
But enabling dhcp in pihole, adding the correct ip range, gateway address etc and deactivate dhcp in my router configurations, i'll simply get no internet connection. Also in Currently active DHCP leases
(pihole) there are no devices. It's simply not working. I think the main issue here is something with docker and the network settings. Maybe adding a macvlan? I don't know. I don't have much knowledge about this network type.
So can someone tell me how to set up a proper docker-compose for pihole and unbound which can also work as a dhcp server?
So long story short: Just ignore the fact, that i also want to run unbound. I need a working pihole docker-compose for dhcp.
Details about my system:
Running pihole in a docker container, the latest version, which is currently for docker with the latest tag: Pi-hole v5.6
Intel NUc, running manjaro system: Linux version 5.9.16-1-MANJARO (builduser@LEGION) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Mon Dec 21 22:00:46 UTC 2020
Docker is running as Docker version 20.10.11, build dea9396e18