cancel
Showing results for 
Search instead for 
Did you mean: 
1

Ask

2

Reply

3

Solution

Pi Hole as DHCP server

Onurcay
2: Seeker
2: Seeker

I received a new broadband set from Vodafone and though while I upgrade to the UltraHub I will also make my RPI PiHole the DHCP server for my network. Here is what I did.
Set Static IP on the RPI for v4 and v6. 
Set the default dns servers on the router to point to the RPI. Great addblock works now. 
Set the DHCP server at the PiHole assign router as gateway. Set up a range. 1.10 to 1.250 allow ipv6(SLAAC+RA) and rapid commit.
Turn off the DHCPv4 at the boradband but keep IPv6 option on. 
Reboot router then reboot RPI.
Seems like everything is working. But there is a problem one of the smart tvs go down the one that has ipv6 on it the other one from the same brand but smaller and older I think doesnt have any issues. So I think problem lies with IPv6 so I fiddle with it make sure everything is set correctly (This is where I set the IPv6 address at the router btw). Seemingly the tv works now. 

But now the PS5 doesnt work.. I thought maybe the same issue but I am out of fixes. So just troubleshooting. I realise I actually dont have ANY IPv4 DNS connection. 
Here is what I did. On the RPI I run tcpdump. then run a dig command on a client. "dig @<RPI IPv4 > somesite.com" (this doesnt work btw thats how I realised the problem (just running dig works after it says comms error timed out then switches to v6)). 
Go back to the RPI I can see my ip show up so its reciveing the request it then goes to some dns server and does A? for that site then returns the answer back to client IP. However client doesnt get anything.

Now this makes me think that the router just ate my dns packages... I dont know what else it could be. I do have docker and tailscale on the RPI but I doubt its them thats interfering. Infact docker is just installed there is no containers running. 

Also I see some dns reqeusts on the tcpdump from router for g.live the microsoft servers. and that seems to be resoved and sent back to the router I am not quite sure what I am seeing on the tcp dump but the router logs say "Possible DNS rebind attack detected"  There are also some random ips the firewall blocks from time to time I dont think they are related. 

So I do not know what to do to further test if someone has any idea let me know. It seems right now as my ipv4 dns calls are being eaten by the router. 

PS: Client can ping RPI and RPI can ping client. There is a stable ssh connection between them. 

7 REPLIES 7

Cynric
16: Advanced member
16: Advanced member

@Onurcay I have PiHole, but I deliberately turned off IPv6, so my config is slightly different.

My router has #1 DNS as the PiHole and #2 DNS as 8.8.4.4 so I still have DNS capability if I am doing something on the Pi. I suspect that you should use the PiHole to also provide all of the IPv6 services and currently there is a conflict between the router and the PiHole.

Let me know how that goes. 

I am not sure I understand what you mean fully. You are suggesting I point the main dns to the pi and the secondary one to the google dns. As you say this will mean that the router will have the ability to go thru google instead of the pi which will disable the adblocking in cases where there is a routing problem with the pi. This part I kind of get. The second part I am not too sure what you mean. 

In the router settings I set the DHCPv4 server off. In the same page for Vodafone Ultrahub there is an option for IPv6 now I am not too sure what this options does I cant seem to be able to find any documentation online regarding it either so I just assumed the button labeld IPv6 would allow for IPv6 connections in the network. Now I dont know if this uses PiHole DHCP server or its own DHCPv6 server I dont know. I tried turning that off but that seemingly made it so that I dont have any internet access. Which makes sense if what I think is true(IPv6 capability) since the pihole only seems to be communicating over ipv6 and also adblock seems to work. I set all of my dns(now removed the IPV6 address) to the pihole. Now I cant get my head around how its actually working. Because running ipv6 tests online and trying to ping ipv6 google doesnt work. I can do normal v4 pings to google. On top of that it seems I can to dig and nslookup using ipv6 but not using ipv4.... 

So 

IPV4 Ping Yes DNSlookup No
IPV6 Ping No DNSlookup Yes

So I dont know what is going on. 

Here are some errors that show up on the PiHole semi regularly. 
Warning in dnsmasq core:

DHCP packet received on eth0 which has no address

and 
Warning in dnsmasq core:

no address range available for DHCP request via docker0

 

Cynric
16: Advanced member
16: Advanced member

@Onurcay My mistake, I was answering from memory.

On the router DNS is OFF, the PiHole sends an announcement to port 53. It's on the PiHole I have the cascade of DNS endpoints which is followed in strict order.

I have IPv6 OFF for both the router and PiHole. If you set DCHP ON then do it on PiHole instead of the router. 

I don't use a Vodafone router, so I have to make allowances for possible differences there.

I think the problem lies in this specific router.. Has to be. I have tested with the old router the one thats getting replaced. That seems to work fine. Granted that router doesnt have ipv6 capabilities. 

Seemingly DHCP PiHole doesnt work on this router. Well to an extent I think IPv6 is working. Although I am suspecting that its using vodafones DHCPv6 servers.. I couldnt verify that though I am not too versed in IPv6. 

On this router you dont have an option to turn off dns you can just set a dns server so I did that and point that to the pi. I turned of DHCP and seemingly the DHCP side of things work. Devices get new IPs from the pihole. The DNS lookup seems problamatic though. And also ping6 on client devices(This is actually quite weird.. I can ping6 google sometimes and sometimes I cant and I cant seem to ping6 anywhere else either. I have no idea what causes this behaviour).

Honestly I am a bit lost and I need a little bit of hand holding to get me back to the right point to troubleshoot and debug this. Since things work sometimes I cant even keep track of what is working and what is not and caching doesnt seem to be helping. Various diffrent online tools say diffrent things as well. Doing an IPv6 Test online I get very bad score on one site very good on another and another client gets very good on both but still cant ping ipv6 netflix.com for example. 

Onurcay
2: Seeker
2: Seeker

A little update. 
Seems I can do `dig +tcp <ipv4 pihole> website.com` 
but normal still doesnt work. And I can see both the tcp request and udp request on the pihole dashboard. This makes me thing its still a router issue. 

Cynric
16: Advanced member
16: Advanced member

@Onurcay have you tried ‘tail -f /var/log/PiHole.log‘ either from the GUI or a terminal (ssh) session to see what is going on?

Yes I can see my client request both udp and tcp. The logs look exactly the same. Request comes in and gets cached. As I said TCPDUMP also shows the request coming, resolving and being sent back to the client. Client never receives the package though.