Cannot get PiHole DHCP Server to work with AVM Fritz!Box

Problem

I'm running Pi-Hole on a Raspberry Pi Zero W 2. I have several A and C DNS records mapped to different services on a separate machine in the network.
I have enabled the DHCP Server in the settings and I have disabled the DHCP server running on my router. I'm now trying to connect to my local instances through local domains like service.home.local from within my home network, which however does not resolve to the actual IP. Looking at the windows configuration and the output of nslookup:

Default Server:  fritz.box
Address:  <some ipv6 address>

it seems like the primary DNS server is still set to my router. In the windows network configuration, the ip of my raspberry pi running the PiHole and thus the DHCP server is listed as the only IPv4 DNS Server, while the first ipv6 address listed in the IPV6 DNS Server section is the same as in the output of nslookup. Is there any reason why the IPv6 entries are preferred here? Regarding the second IPv6 DNS Server IP address, I cannot tell which device it corresponds to nor where it comes from.

This problem is not only present on my Windows machine, but also on my Android phone and other linux machines in the same network (i.e. every other device). At this point I'm just running in a circle trying to figure out the issue. When connecting to my network using a WireGuard tunnel, everything works as expected since I set the DNS in my WireGuard config to use the ip of the pihole.

I'd be happy to provide more information as needed.

Expected Behaviour:

I would expect the PiHole DHCP Server to distribute the correct DNS server (which ironically it does, but apparently not as the primary one?).

Actual Behaviour:

The ip of the pihole is not distributed as the primary DNS server, which is still set to the ip of my router.
ping-ing or curl-ing the A record (home.local) or C records (x.home.local which just forwards to home.local) do not resolve. Running dig @192.168.178.105 home.local answers with the correct IP, but when omitting the @105.168.178.105 (which is the IP of the host running pihole), dig is not able to resolve the IP since it's using some other server.

Debug Token:

https://tricorder.pi-hole.net/SX7tt7c2/

IPv6 capable clients most often would prefer to communicate with IPv6 targets (unless you'd adjuste a clients IPv6 prefix policies individually).

You should note that DHCP is strictly IPv4.

Stateful DHCPv6 would be roughly equivalent, but most OSs would use SLAAC to join an IPv6 network, where it's your router's job to advertise an IPv6 address as DNS server.

Obviously, your router is advertising its own IPv6 address as DNS server, allowing your clients to by-pass Pi-hole.

You'd have to find a way to configure your router either to advertise your Pi-hole host machine's IPv6 as DNS server or to stop advertising its own.

I'd recommend the latter, and that is supported by FritzBox routers, see e.g. Unresolved ipv6 adress in my top list - #4 by Bucking_Horn.

In case you did really configure your router to use .local as your local domain name (aka search suffix): *.local FQDNs are reserved for usage by the mDNS protocol as implemented e.g. by Apple's Bonjour and should NOT be used with plain DNS.

1 Like

Wow, thank you so much for your help, it works now!

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