Pi-hole and ddwrt settings

Hello there . I really need your help guys .I cant make pi-hole to work from 2 days now. I have a router linksys wrt1200ac with ddwrt installed and probably there's some setting that cause a conflict even if i didnt remember to have change something in the last 2 months. I tried reinstall pi hole , change even the rom of the raspberry(from osmc to pidiet) but nothing. After i have configured it when i put to the router the ip of the raspberry as dns , the pi hole web page doesn't seem to open anymore and even the web interface of the Nas (Network error occurred. Check your DNS and network settings) and plex isn't accessible anymore too. I tried change some settings on the router but i didnt seem to understand good what are all the DNSMasq options so i attach 2 screenshots with my configuration. After i put the google dns on the router page all devices seems to work again .If it can be helped (i don't know if it can affect in certain way) there's also a vpn configured with Policy based Routing for certain clients in the router. i cant even ssh in the raspberry . From the raspberry . I checked /etc/dnsmasq.d/01-pihole.conf and the nameserver with 8.8.8.8 are there. Moreover if i dig www.google.com it seems that is resolved without problem . I'm almost sure that the problem is a ddwrt. Someone can give me his lights? Im really desperate to make it work again without installing pi-hole on the nas as the i loose the hibernation option then.

My setup and recommendation:

Disable dnsmasq on the Services page.

Under Network Setup change "DHCP Type" from DHCP Server to DHCP Forwarder, then put in the IP of your Pi-hole.

Then on the Pi-hole settings page, enable the DHCP server there.

Save and then reboot the router for good measure.

1 Like

Better yet, disable DHCP on the router.

1 Like

Setting it to DHCP Forwarder will make all the other options disappear, disabling DHCP, and just instructs the router to look elsewhere for the DHCP server.

1 Like

Thanx for the replies guys! i will surely try this setup ! Seems much more straightforward.

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

No other changes on DD-WRT are needed. Substitute the IP of your pi-hole for the 192.168.1.250 above. Why do it this way? 3 reasons:

  1. Per-host tracking on Pi-hole (i.e. logging of DNS requests tied to individual machines by their respective hostnames).
  2. The ability to resolve hostnames on the LAN.
  3. Ad blocking/network monitoring provided by Pi-hole.
8 Likes

wanted to say thanks for this. Saved me a lot of headache. Had some issues with my DD-WRT seeming to not use the Static DNS setting, which allowed my ISP to hijack some DNS queries (seemed like some DNS went to pihole, some went to my ISP instead). This seems to have fixed it completely, along with me not having to redo my network settings to use PiHole's DHCP server

2 Likes

@graysky2 Cheers for the info as it does feel like web pages load a like faster using this method

1 Like

@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