Pi-Hole Configuration

huffie

Senior Member
Joined
Mar 9, 2007
Messages
1,199
Reaction score
2
Currently I have a router gateway (running Openwrt) that routes DNS to a local machine installed with Pi-Hole, however, when I look at the log file I only see the IP address of the gateway instead of the original local IP address ( I only see it comes from 192.168.1.1 instead of 192.168.1.55 that is making the request).

As such, have I missed out some configuration on the OpenWrt or on Pi-Hole itself? Or this is the normal behaviour unless I specify DNS on all machines to point to the Pi-Hole IP address explicitly? Thanks.
 

lilycll

Senior Member
Joined
May 7, 2018
Messages
2,012
Reaction score
498
Currently I have a router gateway (running Openwrt) that routes DNS to a local machine installed with Pi-Hole, however, when I look at the log file I only see the IP address of the gateway instead of the original local IP address ( I only see it comes from 192.168.1.1 instead of 192.168.1.55 that is making the request).

As such, have I missed out some configuration on the OpenWrt or on Pi-Hole itself? Or this is the normal behaviour unless I specify DNS on all machines to point to the Pi-Hole IP address explicitly? Thanks.

I believe you are confused with the DNS server used by the router vs DNS server (Pi-Hole) used by the Client assigned by the Router DHCP Server.

The Router has a Static IP Address example 192.168.0.1 setup by you. You also configure it to point to the DNS Server on Pi-Hole IP Address example 192.168.0.2 instead of an external Public DNS Server. This mean whatever the Router query will go thru your Pi-Hole DNS Server and out to the Public DNS Servers (configured on your Pi-Hole).

On the other hand, I have seen some Router firmware DHCP Server do not have any option to define the DNS Server but default to the Router IP Address. Example, The Router IP Address is 192.168.0.1. It has a DHCP Server that assigned an internal IP Address 192.168.0.3 to a Client (PC/Mobile). Since there's no DHCP option to define the DNS Server, it default to it's own Router IP Address 192.168.0.1.

Base on above setup, this mean the Client DNS Server/s is actually pointing to the Router DNS Server 192.168.0.1 instead of your Pi-Hole DNS Server.

You need to check your client DNS Server (even if is assigned by the Router) settings. If their DNS Server is pointing to your Router IP Address instead of your Pi-Hole Address, then your finding is valid.

The only way to overwrite the DNS Server to point it to your Pi-Hole is to configure Static IP Address for the Client and point the client DNS Server to your Pi-Hole IP Address. Thereafter you should be able to see your client queries on your Pi-Hole Log.
 

huffie

Senior Member
Joined
Mar 9, 2007
Messages
1,199
Reaction score
2
ok, for easy illustration let's use
Router DNS Server as 192.168.0.1
Pi-Hole Server as 192.168.0.10 (static IP)

So within Router DNS Server I have set primary DNS: 192.168.0.10
secondary DNS: 8.8.8.8
tertiary DNS: 1.1.1.1

Hence, DHCP clients should look-up to 192.168.0.1 which in-turn will look-up 192.168.0.10 (primary first), right?
So, if I have a query from client, 192.168.0.123 , the Pi-Hole query will still show it's from 192.168.0.1 instead of 192.168.0.123. So my question is how to show it was actually from 192.168.0.123, etc etc instead of just single source 192.168.0.1 ?
 

lilycll

Senior Member
Joined
May 7, 2018
Messages
2,012
Reaction score
498
ok, for easy illustration let's use
Router DNS Server as 192.168.0.1
Pi-Hole Server as 192.168.0.10 (static IP)

So within Router DNS Server I have set primary DNS: 192.168.0.10
secondary DNS: 8.8.8.8
tertiary DNS: 1.1.1.1

Hence, DHCP clients should look-up to 192.168.0.1 which in-turn will look-up 192.168.0.10 (primary first), right?
So, if I have a query from client, 192.168.0.123 , the Pi-Hole query will still show it's from 192.168.0.1 instead of 192.168.0.123. So my question is how to show it was actually from 192.168.0.123, etc etc instead of just single source 192.168.0.1 ?

Does your OpenWrt DHCP Server settings has an Advanced Settings tab?

If you can find it, there is a DHCP-Options to setup additional options. Example, to assign another DNS Server (Option Code 6) to your client pointing to your Pi-Hole. The DHCP-Options is in the format of 'DHCP Code, value' Example

6, 192.168.0.10

Try the above and verify if your client DNS Server is pointing to Pi-Hole instead of Router after re-obtain/refresh IP Addresses from Router DHCP Server.

If you are interested to know more about the DHCP-Options, check this Link
 

xiaofan

High Supremacy Member
Joined
Sep 16, 2018
Messages
30,193
Reaction score
8,257
I have just gone through the exercises of migrating from Cloud based Pi-hole to local Pi-hole Docker Container under both OpenWRT (Raspberry Pi 400) and Asus RT-AX82U. The two Pi-hole containers are running on an mini PC running Ubuntu Linux.

For OpenWRT this is what I do.
OpenWRT -- Network -- Interfaces -- LAN -- DHCP Server -- Advanced Settings -- DHCP Options
Fill in "6, your P-hole IP" or "6, 192.168.0.10" in your case.

In that case you should be able to see the LAN clients listed in your Pi-hole query log.

For now I still set the WAN side to use the Pi-hole Cloud based DNS as the primary DNS and "1.1.1.3" as the secondary DNS. So far it seems to be okay.
OpenWRT -- Network -- Interfaces -- WAN -- Advanced Settings -- use custom DNS servers
Fill in "8.8.8.8" and "1.1.1.1" or which ever DNS servers you like to use.

Testing of DNS Leak
https://www.dnsleaktest.com/
Testing of Pi-hole ads-blocking
https://d3ward.github.io/toolz/adblock.html
I can get 100% with the huge list mentioned here.
https://forums.hardwarezone.com.sg/...ocking-on-google-cloud-compute.6375286/page-2
 

huffie

Senior Member
Joined
Mar 9, 2007
Messages
1,199
Reaction score
2
Thanks all for the suggestions, will try out this weekend and see how things go and update yawll.
 

Catpuke

Senior Member
Joined
Feb 8, 2004
Messages
1,163
Reaction score
3
I have just gone through the exercises of migrating from Cloud based Pi-hole to local Pi-hole Docker Container under both OpenWRT (Raspberry Pi 400) and Asus RT-AX82U. The two Pi-hole containers are running on an mini PC running Ubuntu Linux.

For OpenWRT this is what I do.
OpenWRT -- Network -- Interfaces -- LAN -- DHCP Server -- Advanced Settings -- DHCP Options
Fill in "6, your P-hole IP" or "6, 192.168.0.10" in your case.

In that case you should be able to see the LAN clients listed in your Pi-hole query log.

For now I still set the WAN side to use the Pi-hole Cloud based DNS as the primary DNS and "1.1.1.3" as the secondary DNS. So far it seems to be okay.
OpenWRT -- Network -- Interfaces -- WAN -- Advanced Settings -- use custom DNS servers
Fill in "8.8.8.8" and "1.1.1.1" or which ever DNS servers you like to use.

Testing of DNS Leak
https://www.dnsleaktest.com/
Testing of Pi-hole ads-blocking
https://d3ward.github.io/toolz/adblock.html
I can get 100% with the huge list mentioned here.
https://forums.hardwarezone.com.sg/...ocking-on-google-cloud-compute.6375286/page-2
This worked for me. Thank you!
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ. Forum members and moderators are responsible for their own posts.

Please refer to our Community Guidelines and Standards, Terms of Service and Member T&Cs for more information.
Top