Conditional Forwarding with an EdgeRouter Help


#1

Please follow the below template, it will help us to help you!

Expected Behaviour:

Host names should be visible for both 192.168.x.x subnets

Actual Behaviour:

Only one subnet is showing hostnames

Debug Token:

yq4mur1msh

Hi folks,

I posted this on Reddit although it hasn’t had any responses so i was hoping someone on here could perhaps offer a bit of advice please. I’m having problem getting host names to appear for both my subnets.

I have the router ports setup as follows:

Eth0 – Internet
Eth1 – Wired LAN Devices - 192.168.1.0/24
Eth2 – WiFi Devices – 192.168.2.0/24

I’m using the EdgeRouter as the DHCP server, it serves IPs to both subnets, I’d like to continue using this setup, not the Pi handing out IPs.

I have setup dnsmasq on the router to listen on both LAN subnets and set home.lan as the local domain on the router and on the DHCP settings, this all seems to work.

The problem I’m having is getting Pi-hole to report the hostnames of devices on both the LAN and WiFi subnets.

If I set the Pi-hole conditional forwarding setting to point at 192.168.1.1 it reports the host names of the wired devices, but not the WiFi connected devices on the other subnet. If I point the forwarding at 192.168.2.1 it does the opposite, WiFi host names are shown and not the wired.

Doing a bit of reading I’ve seen mention of creating a 05-custom.conf file in /etc/dnsmasq.d, which I’ve tried with the following settings:

server=/Local/192.168.1.1
server=/WiFi/192.168.2.1

That doesn’t appear to work, so I must be missing something. Any suggestions please? Is there a way to get this to work without setting static IPs and putting them in the Pi’s host file?

Many Thanks


#2

Add the hosts to /etc/hosts i did that, i use USG pro for my dhcp


#3

Replied on https://www.reddit.com/r/pihole/comments/9fq4ii/pihole_conditional_forwarding_with_an_edgerouter/