Pihole ubuntu 22.04 with vodafone router without dns settings

phole dhcp up from range 192.168.0.2 - 192.168.0.200
vodafone router dhcp up from range 192.168.0.220 - 253
there is only option to deactivate dhcp leases and set static ip address
at this moment there is only a single static ip which is pi.hole host 192.168.0.222

Expected Behaviour:

nslookup pi.hole on host, which install pihole should show pi.hole IP
dig pi.hole should not show 192.168.0.1 and show pi.hole IP

question:
How to force phole as dns server on 192.168.0.222 and not the router 192.168.0.1 and make other devices to use phole dns server when they connect to the router 192.168.0.1?

if router 192.168.0.1 dhcp turn off then the other devices does not get the dhcp leases from pi-hole host after restarting or flush the dhcp leases.

Actual Behaviour:

on pi-hole interface show some queries and blocks but it still show ads on e.g cnn.com.

dig @192.168.0.222 pi.hole show

dig phole not show A record.

router dhcp off
phole host dhcp on
other devices does not get ip from phole

Debug Token

hHOSIUQj

Your debug log shows two active DHCP servers:

*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
   Scanning all your interfaces for DHCP servers
   
   * Received 356 bytes from wlp3s0:192.168.0.1
     Offered IP address: 192.168.0.222
     DHCP options:
      router: 192.168.0.1
      dns-server: 192.168.0.1
      ntp-server: 192.168.0.1

   * Received 300 bytes from virbr0:192.168.122.1
     Offered IP address: 192.168.122.74
     DHCP options:
      Message type: DHCPOFFER (2)
      router: 192.168.122.1
      dns-server: 192.168.122.1

The first one is your router, the second one could be your Pi-hole (and it seems that Pi-hole is hosted on some kind of virtual environment).

Assuming 192.168.122.1 is your Pi-hole's virtual internal address, note that it is operating on a different subnet from your router.
Consequently, it is highly likely that regular clients from your router's 192.168.0.0/24 won't be able to acquire a lease from your Pi-hole's DHCP server operating on your virtual environment's 192.168.122.0/24 subnet. DHCP negotiation is initiated via broadcasts, and those are restricted to the same network segment/link/collision domain.

This would indicate a routing issue - you'd have to figure how to control that with your chosen virtualisation environment.

thanks for the diagnosis. Yes it seems the host, which pihole run on, has two DHCP servers, one with pihole itself and one was created to be my virtual bridge, which used for two kvms on the host itself.
When I turn both dhcp on pihole and on router, then assign the static IPs for my other devices like phone or tablet then somehow the devices get the the IPs from the pihole and start to show queries/blocks? I am not really sure how it works but what I did is limit the dhcp range as small as possible on the router and assign static IP of the host running pihole on this router.

No.
The machine hosting your Pi-hole is living at 192.168.0.222.
As explained, your debug log shows the first DHCP packet to originate from 192.168.0.1 - that is your router.

Unless you configure whatever virtualisation environment you are using to correctly route packets as required, your regular wlp3s0 clients will never be able to acquire a DHCP lease via Pi-hole, as that is on virbr0, a different link.

As for Pi-hole's DNS operation, you should also note that your router is still distributing its own IPv4 as DNS server.

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