Pi-hole and ddwrt settings

@graysky2

Is there any additional settings to change in DD-WRT? I have added:

in DD-WRT, however when I go to Pi-hole, I still get connected clients as the router, so I am unable to perform per-host tracking.

Thanks

These are the three things I did to get it to work:

  1. Services>services>Additional DNSMasq Options: dhcp-option=6,192.168.1.100
  2. Setup>BasicSetup: Gateway 192.168.1.255
  3. Setup>BasicSetup: Local DNS 192.168.1.100
    You can get the gateway and DNS from the query:
    ip -4 addr show | grep global

Hi

I have been trying to get this work but Iam not having any luck. I tried disabling dhcp on dd-wrt, tried forwarding etc. I am wondering if someone who was able to make it work can post their whole main settings page of the dd-wrt router ?

thanks

Also does this work for you really? I cant seem to get that one work either, I wonder if my firware is borked with the dhcp stuff :frowning:

I am running DD-WRT v3.0r36070M kongac (05/31/18) and that's all I need to do.

graysky

dont want to hijack this thread but i feel its similar, your setup closely resembles whats describe in #2 at this link How do I configure my devices to use Pi-hole as their DNS server?
Reading the instructions from this page got me up and running quickly but...

The last thing they mention is to go into pi-hole dns settings and set the only upstream DNS IP pointing back to the router. they did not really explain why, but I would have thought this would cause a loopback issue with the router forwarding DNS to pihole and then pihole sending it back to the router bank and forth?

I am also using ddwrt and got it up and running but the new dnsmasq support 4.0 has introduced has me excited about getting getting more detailed reports from individual clients rather then them all look like they're coming from the router itself.

Yes, I wrote that :slight_smile:

If you set it up as shown, individual requests do indeed get logged as such. That has been the case before version 4 though.

yea i noticed that after I posted. haha.

but I was more interested in the reasoning in setting pi-holes upstream DNS as going back to the router - what does setting this way accomplish? router's DNS -> to pi-hole and pi hole DNS -> Router

it looked like a loop to me. so this is more for furthering my understanding of networking and routing in general.

thanks

1 Like

I'm also interested in understanding why the upstream in Pi-hole should be set to the router. Does that mean the router's DNS servers should be set to whatever we would've set to the upstream in ph (ex: Cloudflare)?

It seems that this is creating a lot of hops for allowed lookups:

Client -> Pi-hole -> Router -> Upstream

I describe this particular setup so allow for the items listed in this post. WIthout that setup in my experience, they are not possible.

The DNS in the router can be set to whatever you wish, your ISP's, quad9, cloudfare, etc.

I cannot comment on the hops but I can tell you that in my testing with dig using the setup, I measure times in the low double digit msec.

1 Like

I am very new to Pi Hole Set-up. I have set-up but there is one thing I am not sure about if I am doing it correctly. Because when I use dhcp-option=6,192.168.1.2 which is my Pi Hole IP, then do I still need to set DNS Server 1 to 192.168.1.2 under LAN in the router? Or it does not matter? I kept DNS Server 1 to 192.168.1.1 (my router IP) and set dhcp-option=6,192.168.1.2 in router dnsmasq. In PI Hole I set my upstream to Custom 192.168.1.1, as suggested in guide, it did not block any ads. The query did not go up when I visited sites. So my question is when dhcp-option=6,192.168.1.2 is defined, do I still set DNS Server 1 to 192.168.1.2 in LAN in router? Thanks in advance.

The answer to your question was written in the original post:

1 Like

I understand this bit but I think the issue, or one can say my confusion is, before setting up Pi Hole I was using dnsmasq for custom domains, for example address=/test.lan/192.168.1.10. The LAN DNS field was set to 192.168.1.1. Now following this method I just add dhcp-option=6,192.168.1.2 in my dnsmasq and I do not touch or change anything in LAN DNS field (that is, it remains 192.168.1.1). My WAN DNS are Google's. Pi Hole is using Custom DNS for upstream pointed to 192.168.1.1 (my router). With this set-up DNS works okay, internet is fine. But nothing logged in Pi Hole. The query count does not go up when I visit sites and ads are not blocked. However, when I change my LAN DNS in router to 192.168.1.2 (my Pi Hole IP) then Pi Hole starts ad blocking. So the confusion is if I were to use dhcp-option=6,192.168.1.2 option only then why it does not work when I do not change LAN DNS. Is it correct to have LAN DNS to 192.168.1.2 and dhcp-option=6,192.168.1.2 at the same time 'cos that seems to work. Sorry - OP suggestion is very simple but somehow I did not get correct results. Thanks in advance.

Okay, I seem to have solved my issue - or looks like solved unless something pops up later incorrect. I removed the 192.168.1.1 entry under LAN DNS Server 1 and left it blank. I assume by default it is blank as well - I only input 192.168.1.1 for LAN DNS Server 1 in the past following a guide to setup dnsmasq manually. So far after removing this entry the Pi Hole is now seeing the queries and client DNS shows Pi Hole IP as DNS as defined in dnsmasq. For my other uses of dnsmasq, I guess it does not make difference whether I inout 192.168.1.1 in LAN DNS Server 1 cos I assume dnsmasq manual entries will function anyway. Thanks.

A post was split to a new topic: Individual clients not shown using DD-WRT router

This worked great for me thank you! Many hours of frustration solved :slight_smile:

@graysky2
Trying to document all the setup I did recently so I can reproduce it later lol.
In your guide I realized I actually missed a step, I am doing option 2 and realized I never set the upstream DNS in PiHole to point to my router, I still have quad 9 selected in there. Seems to be working without this and I see you commented above that you had found you needed this to get all three things you were after working.
Am I missing something that I am just not seeing not work - or perhaps that step is no longer needed? Just trying to figure out if I am simply not seeing something.
Thanks!

@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!