Cant get DHCP to work

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

this is image of error

this is my router settings

Debug Token:
pihole_debug.txt (25.7 KB)

While you're waiting for the tricorder analysis, perhaps changing to FTL port to 4712 would help?

See attached (may have to Google translate):

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
1 Like

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

Docker Desktop for Windows will not be a DHCP server with any configuration or yaml.

You don't need to buy a Raspberry Pi specifically, any linux based server will work.

1 Like

okay thanks, ill buy rpi, i think its best option cuz i dont have linux machine.

can you suggest good source for installing pihole to rpi

Start with our documentation page:

Flash an OS (Rasperry Pi OS is popular, and they have a good Imager software).

Then install Pi-hole per our documentation.

Configure your network per our post-installation documentation.

@StefanIvovic If you have hyper-V capable version of Win11 (e.g , Pro), you can create a debian vm with that and achieve DHCP.

@Blockhead with like vmware or docker. i am not that savvy with linux network setup, if its complicated and requires extensive setup its not for me :slight_smile:

You don't want to have your DHCP server somewhere that isn't running 24/7.

Yes i am aware of that. If its down internet wont work

No, if the DHCP server is down then the network inside won't work.

I will buy rpi 4 this evening and i will set it up and just leave it there. So i assume there will be no problem

1 Like

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.

You don't need to ping any of us by name. We all see all the posts.

1 Like

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.