OpenWrt + PiHole

Hi all!
In pi-hole official tutorial, it told - not to put pi-hole DNS in wan network interface
When i put pi-hole DNS in wan + all lan's it works.
When i put only in LAN openwrt section, it don't.
Is OpenWrt require put pi-hole DNS in wan section?

Disable peer DNS on all upstream interfaces, that typically includes WAN and WAN6.
Then specify own resolvers on the interface, which the resolver is reachable over.
If case of a local resolver, it is fine to specify on the LAN interface.
Make sure your local resolver uses ISP DNS or public DNS as its upstream provider.

I have no wan6. Yes, i did that exactly as you say, and it does not work if i put it only in LAN, but work with LAN+WAN.

This work.


config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fda5:c239:7ff1::/48'

config interface 'LAN_1'
	option proto 'static'
	option ipaddr '192.168.1.1'
	option netmask '255.255.255.0'
	option device 'eth0'
	list dns '192.168.2.175'

config interface 'wan'
	option device 'eth1'
	option proto 'dhcp'
	option peerdns '0'
	list dns '192.168.2.175'

config device
	option name 'eth0'
	option ipv6 '0'

config device
	option name 'eth1'
	option ipv6 '0'

config device
	option name 'eth2'
	option ipv6 '0'

config device
	option name 'eth3'
	option ipv6 '0'

config interface 'LAN_2'
	option device 'eth2'
	option proto 'static'
	option ipaddr '192.168.2.1'
	option netmask '255.255.255.0'
	list dns '192.168.2.175'

config interface 'LAN_3'
	option proto 'static'
	option device 'eth3'
	option ipaddr '192.168.3.1'
	option netmask '255.255.255.0'
	list dns '192.168.2.175'


When i press - work with ISP DNS or just uncheck the box without put something, even it configured in LAN's it work with ISP DNS resolver.

Isnt it really should work without using WAN interface?

Thid way - does not work

config interface 'wan'
	option device 'eth1'
	option proto 'dhcp'

Specify 192.168.2.175 only on LAN_2 as it is not reachable over LAN_1 and LAN_3.

My lan is
192.168.1.1/24
192.168.2.1/24
192.168.3.1/24

i have no configured 192.168.1.0/24 at all, or i does not understood something?

It is reachable, trust me, when i SSH to 192.168.2.175 (DNS) machine with local resolver i can ping to 192.168.1.1 (router), or from 192.168.1.1 (router) to 192.168.2.175 (DNS)
isnt it mean it reachable?

You have misunderstood the meaning of that setting.
It should be specified only on the interface serving the output/egress DNS traffic.

I understood that, but if i for example wanna use 192.168.2.175 (local resolver) for a LAN1 192.168.1.1/24 and google dns for LAN2 192.168.2.1/24

That's the main problem.

Providing custom DNS with DHCP

1 Like

Look like answer i want! THANK YOU!

1 Like

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