PiHole loses internet when turning on DHCP server

My PiHole (hosted on Orange Pi 5) loses internet connection when I turn off the DHCP on the router and turn on the DHCP on the PiHole. This doesn't happen immediately and I can see that the DHCP is working for connecting devices, but within an hour or so the PiHole will lose connection to the internet and thus all devices on the network also lose access. If I go back to the router and turn on the DHCP then internet comes back on.

I installed PiHole following this tutorial:

Here is my docker-compose.yml:

  GNU nano 6.2                                       docker-compose.yml                                                 services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    network_mode: host
    environment:
      TZ: 'Europe/Berlin'
      WEBPASSWORD: 'xxxxxxxxx'
      PIHOLE_ADLISTS: 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts,https://mirror1.malwaredomains.>      
FTLCONF_REPLY_ADDR4: "192.168.0.31"   
    volumes:
      - './etc-pihole:/etc/pihole'
      - './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      - NET_ADMIN
    restart: unless-stopped

I also assigned static IP address to the Pihole device by editing file @ /etc/network/interfaces:

  GNU nano 6.2                                     /etc/network/interfaces                                              source /etc/network/interfaces.d/*

# Network is managed by Network manager
auto lo
iface lo inet loopback

# PRIMARY network interface
auto eth0
iface eth0 inet static
        address 192.168.0.31
        netmask 255.255.255.0
        gateway 192.168.0.1

Screenshots from Router page and Pihole (ignore enable/disable):



I suspect that the PiHole device is unable to get an IP address from the DHCP :/.

Please can someone help me :frowning:

There may be other network management tools that interfere with that configuration.
That would depend on your OS distribution and variant, so I'd recommend to consult your specific OS's documentation and support for details on how to configure a static IP.

Alternatively, you could try to have your router's DHCP server to coexist with Pi-hole's:
Limit the router's DHCP range to accommodate just for Pi-hole host machine and configure a respective fixed IP address/DHCP lease reservation.

Note that it would take a while for client machines to pick up the new DNS server information from a Pi-hole DHCP lease, as they would hold on to their existing router-issued lease until that expires. This may take hours, days or even weeks, depending on your router's lease lifetime. You may force clients to renew their lease, e.g. by dis- and reconnecting them to your network, or by power-cycling them.

No expert here but I would suggest taking a look at the IPV6 side of things. If your devices connect with IPV6 and you have it enabled you also need to have it enabled on the PiHole dhcp server.

The simplest is to disable IPV6 but if you want to have it on. You need to add that static ip and potentially point your router to that ipv6. Also i am not familiar with that router page but you might also need to point your router to your pihole as dhcp server

if its already disabled I also would suggest using /etc/dhcpcd.conf file thats what I used to set up mine. You can find the default conf file if you dont have it already just modify that and you should be good to go.