I am trying for few days to spin up docker pi whole instance on windows 11 machine with wsl 2. I have managed to do that and have access to pihole but for some reason i cant get dhcp to work. My router does not allow dns change so i read somewhere that i can change dhcp to pihole if i disable routers. I did that but its not working.
i need help fixing this or maybe someone has working docker compose file that i can use.
this is command i am using:
docker run -d --name pihole -e ServerIP=192.168.0.11 -e WEBPASSWORD=password -e TZ=Europe/Belgrade -e DNS1=192.168.0.1 -e DNS2=1.1.1.1 -e DNS3=1.0.0.1 -p 80:80 -p 53:53/tcp -p 53:53/udp -p 443:443 --restart=unless-stopped pihole/pihole:latest
You're not going to be able to use WSL2 as a DHCP server. The network for WSL2 is a virtual interface that can't be used for DHCP. You'd need to use Host mode networking with Docker in order to run DHCP and Host mode does not exist on the Windows platform.
You'd also need to be able to modify the Capabilities in Docker, that's another problem on Windows.
cap_add:
- NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed
okay, is it possible then to use pihole with dhcp on windows docker, if so can you help me with that, ive tried few docker compose yaml scripts with no luck. If its not what would you recommend instead, i can buy rasperry pi if its easy to setup, also my router does not allow to change dns, thats why i am going for dhcp
Yeah, no problems with that. You don't need the power of a Pi 4 if all you are running is Pi-hole, so don't pay more if you can get another Small/Single Board Computer for cheaper.
@DanSchaper I just did the setup and manually assigned my phones dns to pihole and its working.My isp dont allow dns change. So, is there some way that i dont have to manually set dns to every device on network.
When i enable dhcp on pihole shold i also copy all assignments of static ip adresses to pihole from router? And should i use same walues for dhcp as they are on router ?
@DanSchaper i just enabled dhcp on pihole and disabled it on router. I can access internet but i cant access pihole ui, when i enter its address nothing happens.
I need more detail on this. Where are you entering the address, what address are you entering, what is the exact error or display that is shown when you enter the address.