Posted: Fri Jul 23, 2021 20:40 Post subject: DDWRT with Local DNS + optional Pi-Hole
Good evenening
I've been scratching my head for a while with a problem that *should* be easy to solve but somehow it's getting more and more absurd.
My main goal is to setup the DDWRT router as the main DNS for my LAN using DNSMasq (this is covered in many tutorials), and setting Pi-Hole as my secondary or optional DNS for my LAN. Apologies if there is any obvious tutorial explaining this but everything I've found uses Pi-Hole as the only DNS in the LAN.
The main reason behind this approach is I want to have the really important domain names in the router which will be always available, and leave the less important domains for the Pi-Hole which won't be active as frequently.
I'm using DD-WRT v3.0-r30796 std (10/25/16).
Pi-Hole machine is off...
In my DDWRT configuration I pretty much have:
Code:
Local DNS = 0.0.0.0
Static DNS1 = 192.168.2.158 <= the IP of my Pi-Hole
Static DNS2 = 8.8.8.8
Static DNS3 = 8.8.4.4
So far, my Pi-Hole is a regular DNS, nothing special about it.
In order to resolve my lan names (which will be .lan), I do:
Code:
Use DNSMasq for DHCP YES
Use DNSMasq for DNS YES
(all other options, disabled)
The options for DNSMasq are as following:
Code:
DNSMasq ENABLED
Local DNS DISABLED
No DNS Rebind DISABLED
Query DNS in Strict Order ENABLED
Add Requestor MAC to DNS Query DISABLED
In the extra options for DNSMasq I have:
Code:
local=/lan/
address=/router.lan/192.168.2.1
If I do a nslookup for google.com and router.lan I get...
What!? Having reached this point, I'm afraid I don't understand anything and the more I read the more confused I get because this problem shouldn't happen.
If you read until here, many thanks, this is a too long post, I know. Do you have any idea or feeling of what could be wrong?
1. It's a Linksys WRT1900ACS
2. Just updated to DD-WRT v3.0-r44715 std (11/03/20), many thanks for the advice!
Didn't reset the configuration to default but now nslookup is not resolving. I'll continue reading and playing with the new options I see.
Regards
EDIT: Interesting... if I create a new name in the Pi-Hole called router.here, it works for nslookup and also ping. So, there must be something in the router blocking .local domains?
Joined: 08 May 2018 Posts: 14246 Location: Texas, USA
Posted: Fri Jul 23, 2021 21:54 Post subject:
And you zeroed in on the router database instead of the download server link I provided. There is a sticky in the forum about using Pi-Hole with DD-WRT. There is also a wiki about using DNSMasq as DHCP server. If you are going to use local DNS, you have to specify a server...
Joined: 26 Mar 2013 Posts: 1858 Location: Hung Hom, Hong Kong
Posted: Sat Jul 24, 2021 13:29 Post subject: Re: DDWRT with Local DNS + optional Pi-Hole
zerobyzero wrote:
My main goal is to setup the DDWRT router as the main DNS for my LAN using DNSMasq (this is covered in many tutorials), and setting Pi-Hole as my secondary or optional DNS for my LAN. Apologies if there is any obvious tutorial explaining this but everything I've found uses Pi-Hole as the only DNS in the LAN.
The main reason behind this approach is I want to have the really important domain names in the router which will be always available, and leave the less important domains for the Pi-Hole which won't be active as frequently.
You can just use DNSmasq to do it without the Pi. Use the textbox in Services -> DNSmasq -> Addtional DNSmasq Options to store local DNS table. I think the option is "address=".
When you are more experienced, enable and use recursive DNS Unbound to host a local domain with both forward and reverse look-up! And you can have multiple domains! It's more secured than DNSmasq as well.
I think Pi Hole should do something more CPU intensive, as for example, MySQL.
_________________ Router: Asus RT-N18U (rev. A1)
Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!