[SOLVED] Primary DNS Pi-hole, router DNS secondary?

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking
Author Message
Particle Man
DD-WRT Novice


Joined: 07 Jun 2021
Posts: 15

PostPosted: Thu Nov 25, 2021 5:39    Post subject: [SOLVED] Primary DNS Pi-hole, router DNS secondary? Reply with quote
With the router (r47618) running DHCP, SmartDNS (to encrypt DNS), and ad-blocking with dnsmasq, and a Pi-hole behind the router, I would like DHCP to assign the Pi-hole as primary DNS and the router as secondary DNS. But the only DNS that DHCP assigns is the router. Otherwise, DNS generally seems to work as desired.

Basic Setup:
Ignore WAN DNS: enabled
Shortcut Forwarding Engine: CTF
Flow Acceleration: CTF & FA
STP: Disable
Local DNS: Pi-hole
Static DNS 1: Pi-hole
Static DNS 2: router
Use DNSMasq for DNS: enabled
DHCP-Authoritative: enable
Forced DNS Redirection: enabled

Services:
Several static licenses (but not so many that it breaks the UI--a known issue?)
Dnsmasq: enabled

The Pi-hole's only upstream DNS is the router.

My partial workaround, where possible, is to set static IPs.
Sponsor
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 310
Location: All over the webs

PostPosted: Thu Nov 25, 2021 7:05    Post subject: Reply with quote
Hello @Particle Man

Just would like more information on your claim regarding
Quote:
Several static licenses (but not so many that it breaks the UI--a known issue?)

What exactly breaks (screenshot would help)?
How many static IP assignments does that take in order to reproduce?
Which firmware version is this observed on?
Is it reproducible on all current firmware versions as well as older versions than 3 months?

Regarding Static DNS 2: router I presume you mean the router IP? have you enabled No DNS Rebind in Services > Services tab?

You could also refer to https://pi-hole.net/ step 3
Or have a look at https://discourse.pi-hole.net/t/pi-hole-and-ddwrt-settings/3385

Ill wait for answers on the questions above regarding the static leases UI breakages though.

Thanks in advance for the answers.

Have a nice day.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @
#style_it_themes_public:matrix.org or
#style_it_themes:discord
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 11331
Location: Texas, USA

PostPosted: Thu Nov 25, 2021 7:26    Post subject: Reply with quote
The only thing I remember/have found so far is this:

https://svn.dd-wrt.com/ticket/3562

https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=148406

This likely also limits the number of static leases that can be set via the webUI (?). I was trying to find a ticket or thread or post that I remember seeing that only so many static leases can be entered via webUI, but it's not materializing.

_________________
Official Forum Rules, Guidelines & Helpful InformationFirmware FAQInstallation WikiWhere Do I Download Firmware‽
DON'T use Chromium-based browsersRTFM/STFW TL;DR is NOT an excuse. • Why Should I Care What Color the Bikeshed Is‽
Please DO NOT PM me with questions; Ask in the forum. ---------------------- Linux User #377467 counter.li.org / linuxcounter.net
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 8679
Location: Netherlands

PostPosted: Thu Nov 25, 2021 11:06    Post subject: Reply with quote
Maybe it does not apply here but there is a sticky regarding installation of a Pi-hole:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=329571

_________________
Routers:Netgear R7800, R6400v1, R6400v2, Linksys EA8500, EA6900 (XvortexCFE), E2000 (converted WRT320N), WRT54GS v1.
WireGuard Documents & Guides:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327397
OpenVPN Documents & Guides: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327398
IPSET: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=327261
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 1022
Location: Germany

PostPosted: Thu Nov 25, 2021 12:36    Post subject: Re: Primary DNS Pi-hole, router DNS secondary? Reply with quote
Particle Man wrote:
But the only DNS that DHCP assigns is the router. Otherwise, DNS generally seems to work as desired.


with the configuration I could not explain how DNS should work at all.

In the router you have entered as 1st upstream DNS the pi-hole and in the pi-hole the router as upstream DNS

In the router you have entered the router itself as the 2nd upstream DNS

this sounds to me more like DNS loops ∞ and not a working configuration Wink

Particle Man wrote:
With the router (r47618) running DHCP, SmartDNS (to encrypt DNS), and ad-blocking with dnsmasq, and a Pi-hole behind the router


Umm what ?

You want to daisy chain the Pi-Hole (running FTL / dnsmasq with ad blocking) with the dnsmasq of the router running ad blocking as well ...

Isn't one adblocking enough?

Particle Man wrote:
I would like DHCP to assign the Pi-hole as primary DNS and the router as secondary DNS. But the only DNS that DHCP assigns is the router.


Additional Dnsmasq Options:

Code:
dhcp-option=6,192.168.1.110,192.168.1.1


192.168.1.110 = Pi-Hole
192.168.1.1 = Router

but this will not work reliably, because it depends on the client itself in which order it queries the DNS servers

what role smartdns plays here or which real upstream DNS server is used I can't tell at all from your shown data
Particle Man
DD-WRT Novice


Joined: 07 Jun 2021
Posts: 15

PostPosted: Thu Nov 25, 2021 14:39    Post subject: Reply with quote
Thanks, everyone!

"dhcp-option=6,[primary DNS IP],[secondary DNS IP]" seems to have done the trick, assigning DNS as desired.

So, I've since reverted Local DNS and Static DNS 1 and 2 to 0.0.0.0. (Static DNS 2 as the router IP was ignored, anyway.)

Otherwise, No DNS Rebind is disabled (enabling it didn't seem to help), and the router is (still) ad-blocking because the router is secondary/fallback DNS.
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 310
Location: All over the webs

PostPosted: Thu Nov 25, 2021 15:21    Post subject: Reply with quote
Glad you fixed it=) marking as solved.

However still not a single answer from you to my questions regarding the static IP UI breakages, so I'll assume it's not an issue and ignore it.

Thanks and have a nice evening/day.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @
#style_it_themes_public:matrix.org or
#style_it_themes:discord
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum