Pihole + Unbound fails to act as DHCP Server

The issue I am facing:
I cannot use my Pihole as a DHCP Server. Port 67 is open.

Details about my system:
I run Unbound on its standard port, all blocking is good. When i disable the DHCP server of my router and enable the DHCP server of Pihole, using the same settings:

Range of IP addresses to hand out
From: 192.168.0.2
To: 192.168.0.200
Router (gateway) IP address
Router: 192.168.0.1

no IP addresses are actually handed out. I then have to re-enable my router's (TP LINK) DHCP server for my network to work properly again. I don't have to use the DHCP server of the Pi, I'd just like to in order to see hostnames. Also, I set the static IP assignment of my Pihole as well (192.168.0.122)

I don't use Conditional Forwarding currently. I do use DNSSEC.

What I have changed since installing Pi-hole:
Running Unbound

Debug log: https://tricorder.pi-hole.net/u8iCJPeP/

*** [ DIAGNOSING ]: contents of /etc/dnsmasq.d

-rw-r--r-- 1 root root 1.5K Mar 18 19:38 /etc/dnsmasq.d/01-pihole.conf
   addn-hosts=/etc/pihole/local.list
   addn-hosts=/etc/pihole/custom.list
   localise-queries
   no-resolv
   log-queries
   log-facility=/var/log/pihole/pihole.log
   log-async
   cache-size=10000
   server=127.0.0.1#5335
   domain-needed
   expand-hosts
   bogus-priv
   dnssec
   trust-anchor=.,20326,8,2,E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D
   local-service

-rw-r--r-- 1 root root 50 Mar 18 19:03 /etc/dnsmasq.d/04-pihole-static-dhcp.conf
   dhcp-host=10-62-E5-10-B1-36,192.168.0.122,peehole

-rw-r--r-- 1 root root 2.2K Mar 18 18:29 /etc/dnsmasq.d/06-rfc6761.conf
   server=/test/
   server=/localhost/
   server=/invalid/
   server=/bind/
   server=/onion/

It looks like your Pi-hole's OS gets its IP address via DHCP from the router, and that you are using an IP reservation to ensure that it always gets the same address (.122).

When you switch the router's DHCP off and enable the DHCP of the Pi-hole, how does Pi-hole then get its IP address? Could this be the cause of it all stopping working?

The best approach is to configure a static IP on the Pi-hole's OS directly so that it just has it directly, and then ensure that address does not fall within the DHCP's scope.

So for example the router is .1, you might manually configure the Pi-hole OS to be on .2, and then have the DHCP server start handing out addresses from .20 to .254. That gives you a few extra IPs available for more static devices if you need them later on (for example if you got a NAS, that would be good on a static IP, you could use .3 and so on).

Your router's DHCP is also giving out itself (the router) as a DNS server to use. This means clients will sometimes bypass your Pi-hole and use the router. You'll need to make sure that this option is disabled in the router. This could be a good reason to switch to the Pi-hole for DHCP (once you've got the static IP address sorted out), since Pi-hole always gives itself out to use as DNS.

Great, thanks for the pointers! In the Pi-hole web GUI I did set the .122 address as a reserved IP address, but I'll try setting the Pi's static IP on the device directly. I'm using Ubuntu 22.04 LTS for my Pi's OS.

Does this look about right to you for my /etc/netplan/01-network-manager-all.yaml config?

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:  # replace with your network interface name
      dhcp4: no
      addresses: [192.168.0.2/24]  # your static IP
      gateway4: 192.168.0.1  # replace with your gateway IP
      nameservers:
        addresses: [127.0.0.1]  # loopback address for DNS resolution

Thanks very much for your help. Setting the static IP on the Pi was the solution :slight_smile:

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.