Pi-hole and ddwrt settings

@bizarro252 - Are you talking about the official guide? What I wrote there was required for me to get those 3 things working. I haven't changed it since.

I think the most general and “best” method on DD-WRT is to:
Services>services>Additional DNSMasq Options:
dhcp-option=6,192.168.1.250

I had this settings in my DNSMasq for quite sometime now. Is it the same as 'dhcp-option=6'?

dhcp-option=option:dns-server,192.168.1.10

1 Like

@graysky2 yes the one from here :How do I configure my devices to use Pi-hole as their DNS server?

However, I think I may have just not been paying close enough attention, I did not see above that the actual client hostnames were shown, not just their IPs! I will give that last step a shot and see if that pulls those in instead of just the IPs like I have now - thanks!

Correct, it is the same thing.
Thanks everyone for this thread! It saved my evening!

This doesn't work if you use vap on ddwrt though.

Hi,

in that setup do you still have local dns resolving? So this: address=/test.lan/192.168.1.10
It isnt working for me

Yes, it is resolving local dns correctly for me.

Hello and thank you for your tutorial could i ask for some extra clarification.
To see my current settings please see here
My confusion or lack of network knowledge is the loop aspect.
If i follow your guide and remove Cloudflare in the PI-Hole settings my system breaks i get unknown status or clients. Also, how do I specify Cloudflare or Google or any DNS provider if you say remove it and point to just your PiHole IP in your router this seems a loop.
My requirements if possible are as follows

  1. Select the DNS provider of my choice and if so how or where do i set that?
  2. How can I show the client name in PiHole not just the IP address?
  3. Slightly more complex I want to set up the run 2 Pi-hole servers in HA (High Availability) in DD-WRT details here

Cheers in advance
AG

My setup is a bit different but had a lot of headaches and do not know how to address it properly due to the limited networking experience I have.

My setup is as follows:

  1. My Internet router: IP 192.168.15.1 it has port forwarding for Plex

  2. DDWRT router set in "Client Mode" (or WISP as also called): IP 192.168.3.1 it has port forwarding for Plex but also the following options under Services -> dnsmasq

rebind-domain-ok=/plex.direct/
rebind-domain-ok=/pi.hole/

All other options are defaults as per the wiki guide I followed to setup the router as Client Mode

  1. My home router: An ASUS RT-ACRH13 with an IP 192.168.0.1

It has port forwarding, and has set Pihole as only DHCP DNS server. I also set a custom domain name to it, after following this guide: Configuring the Pi Hole with Asus Routers (Merlin or John's Fork) | Carlos Felicio

  1. A Docker Pihole container in Windows. All defaults, except for Shared Memory size which I set to 1.5G and with custom upstream DNS (I used CleanBrowsing)

I also set Conditional Forwarding . This points to my Asus router (IP: 192.168.0.1)

The things or problems I faced are several let me list some of them:

  1. A unusual amount queries answered (up to ~2000) . This happened prior to the "Conditional forwarding" in Pihole, but now it is below ~1000 which I understand is "normal"

  2. I am unable to nslookup microsoft.com or any domain in Android's Termux app. I receive a connection timed out error

  3. My Pihole goes loopty loop after several days querying same domain over and over again. When this happens, any Pihole blocking capabilities go off (no blocking at all)

I think I have determined this one and I think it was my Android phone running with Blokada and thus creating these loops when my phone is connected to my local network. I would have to investigate further, as my Pihole does not log any client other than localhost and 172.17.0.1 which is problem #4

  1. Pihole not logging any client other than localhost or 172.17.0.1

To summarize my network setup should go as follows:

A device connected to the network -> local router -> Pihole -> DDWRT router -> Internet router

Any help or guidance is greatly appreciated.

Thank you!

I had similar problems. This is how I fixed it without compromising on my requirements.

Mine goes device > Pihole > DD-WRT router so it's a bit simpler.

Thank you. I came a similar post where in DDWRT dnsmasq settings apply some of the parameters you listed with the exception of dhcp-option=option:dns-server.

What difference does it have versus dhcp-option=6,IP address ?

I will try connecting my Pihole to the DDWRT router and set those parameters if I still have this problem. One thing I forgot to mention is that I had static routing in my Asus router blocking Google DNS servers: 8.8.8.8 / 8.8.4.4

Not sure if it would make any difference, but I removed them for now, and see if it makes any difference

It's literally the same thing. 6 is the dhcp-option for dnsmasq which means dns-server.

I just like to use full commands if I don't know them well enough to remember specifically what the shortcuts are for as it makes reading them immediately easier at a later date and helps me learn what the shortcuts actually do.

Except for ffmpeg. If you ever use that on the command line for video editing, you might as well just print out the entire website for it and keep it handy.

I'm using an old version of dd-wrt and never got the dhcp-option=6,192.168.1.250 option working.
But I got it working by following this topic.

What I did was unchecking "Use DNSMasq for DNS" (under Setup) and "Local DNS" (under Services).
Then I put the pihole IP under Network Setup -> Local DNS, and not under Static DNS 1.

Many thanks for this simple and effective solution. Put in the settings:

dhcp-option=6,192.168.1.50 <<< my pihole LAN IP

Saved and rebooted router. Worked OOTB! Brill.

1 Like

ahahha im surprised that 5 years after i opened the initial thread, moved to another country, made family, changed jobs...i'm still getting notifications ! Moral of the story? People grow old but a piece of software made with love stays forever ! I'm still using it btw in a slightly different setup. Two pihole instances in HA with gravity sync.One instance runs in docker in my nuc linux server and the other instance on a dietpi raspi along with some Ubiquiti hardware instead of the legendary Linksys router. Long live pihole !

2 Likes

This solution works great -- thank you!
I want to follow this approach but add a second pi-hole as failover in case the first one fails.

Was running my initial pi-hole instance in a container on my NAS and occasionally had issues with it when I was updating and rebooting it where my home network went down and the famsquad wasn't too happy.

Anyhow -- I saw elsewhere the recommendation that you do the following under DNSMaxq Options:
dchp-option=6,first pihole IP address,backup pihole IP address

Is this the best way to do it?

Most likely below also works and is independent of what IP's are configured for the host:

dchp-option=6,0.0.0.0,<BACKUP_IP>

pi@ph5b:~ $ man dnsmasq
[..]
       -O,     --dhcp-option=[tag:<tag>,[tag:<tag>,]][encap:<opt>,][vi-en‐
       cap:<enterprise>,][vendor:[<vendor-class>],][<opt>|option:<opt-
       name>|option6:<opt>|option6:<opt-name>],[<value>[,<value>]]
[..]
       The  special address 0.0.0.0 is taken to mean "the address of the
       machine running dnsmasq".
1 Like

Thanks for the recommendation.
Confirming that I've tested the approach I shared previously and it seems to failover from the primary to backup Pi-Hole without disrupting the network.
May also try your approach in the future!

Hello everyone

dhcp-option=6,192.168.1.50 <<< my pihole LAN IP

this solution also worked for me, but I have a second Wi-Fi network running via VPN and after restarting the Wi-Fi via VPN, there is no DNS,

what can be done about it
<<<<<<<<<<<<<<<<<<<<<<<<<
maybe it will be useful to someone,

dhcp-option=6,pihole_ip
dhcp-option=wlan0.1,6,1.1.1.1,1.0.0.1,8.8.8.8

solved my problem

Man you can´t imagine how much I looked for an answer to why all pihole said was DDWRT on all petittions, thanks so much !!!!!