Install of PiHole on DLink Router not working

Please follow the below template, it will help us to help you!

I have have made two instals of PiHole on two raspberrypi’s - the first one is set up on an Airport Express router and I have changed the router’s DNS to the PiHole and it works just fine. The second one is on a DLink 850 router and it does not work. I read many reports about the inablility to change DNS settings for LAN on DLink so I am just changing the DNS settings on my Macbook that’s linked to the router through LAN

Expected Behaviour:

Ad Blocking

Actual Behaviour:

No Ads are being blocked

Debug Token:

h98lcbzgas

Can you post screenshots of the D-link “DHCP server” options ?

If it lacks the options to assign DNS servers to the clients through DHCP, alternatives are to configure all your clients DNS settings manually or …
disable DHCP on the router and activate the DHCP service from Pi-hole as a replacement:

I’ve tried to activate the Pi-Hole DHCP server but then the Pi-Hole cannot access the internet due to the inability to set LAN DNS on the D-Link router. Now I have set the client DNS to the Pi-Hole server but ads are still not blocked alas!

I cant see the settings that are required to push a DNS server to the clients through DHCP.
Best is to use Pi-hole’s DHCP service.
If you configure Pi-hole’s “Upstream DNS Servers” to that of for example Google’s, you circumvent DNS resolution via your router (take it out of the loop).

Do you have an example link with ads ?

And when on the clients, you do below lookup, does your Pi-hole IP address display like in below example where my Pi-hole IP is 10.0.0.2 ?

$ nslookup pi.hole
Server:    10.0.0.2
Address 1: 10.0.0.2 noads.dehakkelaar.nl

Name:      pi.hole
Address 1: 10.0.0.2 noads.dehakkelaar.nl

I used this and disabled my router’s DHCP server. In this case Iost connection to the internet. I could ping the Pi-hole from the client but nslookup ‘hostname’ was not connecting.

I then went back to routers DHCP and setting ip address of Pi-Hole as DNS on my client and in this case, I was back on the internet but no ad blocking (for example on [Mod Edit: Link no longer available])

Did you disconnect & reconnect network on the client or reboot it after you switched DHCP from router to Pi-hole ?
Whenever you change DHCP settings, you need to do the above or those settings wont propagate (or wait until the DHCP lease expires which could take a long time).

What do you mean, you literally typed “nslookup ‘hostname’” ?
Why didnt you try “nslookup pi.hole” ?
If you want to query a particular DNS server in your network, you could do like so:

nslookup pi.hole <IP_DNS_SERVER>

What “Upstream DNS Servers” do you have configured on the Pi-hole web GUI ?

Try below one, it should display a nice block page:

http://doubleclick.com

Yes - I did that - software and hardware restart on routers and pihole

I tried nslookup pi.hole and also nslookup PiHole2 (which is the hostname I have given to this particular PiHole) - both didn’t work

Google

You said you were able to ping Pi-hole after the switch but were unable to do DNS lookups against it.
Were you able to SSH into the PI after the switch ?
Flipping on the Pi-hole DHCP service should not alter any of the IP details for Pi-hole.
It could be that your router does something like below:

I can see this settings in your router “Enable DNS relay”, not sure what that one does but you could try disabling it (for diagnosing) ?

You could also try connecting a CAT5 cable straight from Pi-hole to one of your clients.
See if the client receives an IP address from Pi-hole and try to do the lookup again with the router out of the loop.

Yes, I have been able to ssh into the pi-hole throughout. I cannot ping the router from pi-hole with DHCP on pi-hole

Flipping on the DHCP server on the pi-hole changes the IP address of the pi-hole to outside the range specified - I guess that’s normal?

Rebind protection - I guess that’s what my router is doing - I don’t know how to turn it off though, its a D-Link DIR850 router and I’ve seen many issues that people have logged with this router on pi-hole

Tried - with no luck :frowning:

Will try when I get my hands on a suitable adapter - I am using a PiZeroW for the pi-hole server and it doesn’t have a CAT5 port unfortunately.

I have now gone back to the following config:
DHCP on router
Client connected via Ethernet to router and DNS on client pointing to Pi-hole ip address
Ads are still not blocked - I ran pihole -d and uploaded the debug data - token is ndis41x35d

Quite confused actually!
Thanks for all the prompt help!

Check Pi-hole’s IP before you switch it on, and what is it after ?

ip a

It should not change.

“Range of IP addresses to hand out” best set the same as on the router.

Check this:

And maybe reboot PC to clear some cache.

All the tools to play with.

Lookup domains using your OS DNS settings on Windows or Linux:

nslookup <DOMAIN>

To query a particular DNS server.

nslookup <DOMAIN> <DNS_SERVER>

Show IP, subnet and MAC for Pi-hole or Linux client.

ip a

Show IP details for Windows client:

ipconfig /all

A nice link that should always show the block page:

http://doubleclick.com

Query Pi-hole for domains:

pihole -q <DOMAIN>

Reconfigure Pi-hole IP address:

pihole -r

Flush cache on a Windows client:

ipconfig /flushdns

Flushing cache on Linux depends who’s doing caching (could be dnsmasq too same as Pi-hole).

I had the same problem, but the following config worked:

Turn off DMZ or point to pihole IP

Add primary DNS as PiHole IP (secondary is set to Google DNS)

Turn off DNS Relay, this will set your client’s DNS to your settings

Note the Firmware Version and update if necessary
https://support.dlink.com/ProductInfo.aspx?m=DIR-880L