Include pi-hole as dns in DHCP config

Hello all,
I would like to solve a situation that I have pi-hole on my local network and I would like my Omnia to hand out config via DHCP where the DNS will be set to my pi-hole server.
So if some client receives network config from omnia (DHCP server), the network config will have DNS as 192.168.1.2.
I also tried adding custom DNS forwarder in …1.1/reforis/network-settings/dns web config but it don’t accept anything from 192.168.1.X range.
That would mean I will have to set DNS on pi-hole to some external server to avoid loop omnia > pi-hole > omnia. - however it doesn’t work.

I don’t mind omnia to use provider DNS (will be only device on network which will use it directly)

I was also thinking to manually edit via ssh one of the DNS in config /etc/resolver/dns_servers/ to 192.168.1.2 but I believe there must be less “hacky way”.

My best guess would be somewhere in …1.1/cgi-bin/luci/admin/network/dhcp web config page, but I’m probably not that good with expert settings.
Started to learn linux and networks recently.

I know there is a way to have pi-hole installed on omnia directly, but I have reasons I want it on other device.

I would be very thankfull for advice.

Set the Pihole to a fixed IP address (e.g. 192.168.1.2) and in Luci ->Network → Interfaces → Lan → Edit → DHCP Server → Advanced Settings → DHCP-Options edit 6,192.168.1.1 to (e.g. 6,192.168.1.2) and restart router. I had it on Turris 1.1, but the path will be the same.
On the Pihole put DNS e.g. 1.1.1.1. Set all clients to DHCP or DNS e.g.192.168.1.2

2 Likes

Here I’d actually suggest putting 192.168.1.1 (i.e. Turris DNS), so that you get local DNSSEC validation, local names (*.lan), etc. But it’s everyone’s choice how to stack this, of course.

1 Like

Of course. I wrote, for example. But it’s everyone’s choice how to stack this.

thanks for the tips
Seems like I have to tweak something else as few well known sites still have plenty of ads, byt clients correctly receive DNS setting 192.168.1.2

You must restart all browsers or clear your browsing data. Otherwise, you’ll still get ads.

I did ipconfig /flushdns but when I also cleared all cache a and cookies from browser, it worked (ads blocked).
Thanks

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