Pi-hole not blocking ads in LAN, only VPN

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

Expected Behaviour:

Pi-hole blocking ads through the LAN.

Actual Behaviour:

Still seeing ads.

Debug Token:

https://tricorder.pi-hole.net/m6viaa3pkc

I installed Pi-hole and PiVPN next to each other. That worked perfectly for about one hour. After that I am getting ads again. Already tried rebooting the Pi, didn't make any difference. :frowning: When I connect to the VPN it is working. I followed this guide: /blog/2017/06/pivpn-and-pi-hole/

The guide you followed is not a Pi-hole official guide.

For that, you can use this as your reference:
https://docs.pi-hole.net/guides/vpn/overview/

At this point, you are most likely seeing ads on your LA because of your IPV6 DNS setting (that are not managed by Pi-hole).

You are not seeing ads via the VPN because that one is IPV4 only :slight_smile:

You can correct the IPV6 related settings on your LAN or disable IPV6 all together ...

Deactivated the VPN, disabled IPV6 in the router and removed the IPV6 line from the setupVars.conf file. Rebooted both the router and the Pi but I'm still seeing ads...

Try a nsloookup flurry.com on a client.

Also try a nslookup ipv6.google.com

What's the output of those commands?

nslookup flurry.com
Server:		192.168.1.1
Address:	192.168.1.1#53

Non-authoritative answer:
Name:	flurry.com
Address: 212.82.100.153
Name:	flurry.com
Address: 74.6.136.153
Name:	flurry.com
Address: 98.136.103.26

and...

nslookup ipv6.google.com
Server:		192.168.1.1
Address:	192.168.1.1#53

Non-authoritative answer:
ipv6.google.com	canonical name = ipv6.l.google.com.

There you go.

Your router is actually your DNS resolver, not Pi-hole.

Whatever you have set up within the router as yous DNS servers is actually resolving your requests.

That domain should have been blocked.

You can either point the router to your Pi-hole IP (but you need to set it up to listen to all, permit all origins as now, it seems to only listen to tun0) or you can manually specify the IP address of Pi-hole on your client(s). and that should take care of it also.

Also keep this in mind:

35

I already set the Pi IP address in the DHCP DNS settings. Should I change something in the WAN section too?

If it let's you, yes as your router actually uses the cloudfare IPs to resolve.

But remember to allow Pi-hole to answer to all requests not only the ones on the tun0 interface.

I allowed the Pi-hole to answer to all requests :+1:

Tried to replace the Cloudflare DNS settings in the WAN section with my Pi IP address. The router couldn't connect to the internet when I tried that.

I then changed it back. When I looked at the DNS settings on my MacBook it is receiving two DNS addresses: 192.168.1.247 and 192.168.1.1. So I tried forcing it to 192.168.1.247, when I did that, I couldn't get any internet on my MacBook.

When I removed that manual DNS address it immediately picks up the Pi + router address again. Then I can get internet again but it's still not blocking the ads.

Maybe I'll reflash and reinstall Pihole tomorrow...

If and when you do, take it one at a time.
Make sure Pi-hole is working and then install OpenVPN.

Use the official guide and it will work without any issues.

“Advertise router’s IP in addition to user-specified DNS” may be the problem. Disable that and see if this resolves the problem.

Flashed my SD-card and installed the Pi-hole. It is working now. I first set up Pi-hole, then I configured Pi-hole over HTTPS and now I'm going to install + configure the VPN.

Thank you for your (quick!) help and support! :slight_smile: I will update this post if I got the full package working!

VPN doesn't work after following this:
https://docs.pi-hole.net/guides/vpn/installation/ and https://docs.pi-hole.net/guides/vpn/dual-operation/

It won't connect to the VPN from my iPhone. Did I forget something?

Here are the config files (/etc/openvpn/server/server.conf and /etc/pihole/setupVars.conf)

34 15

In here, remove the push route line and change the push "dhcp-option from 127.0.0.1 to 10.8.0.1

In the admin interface of Pi-hole, enable listen to all, permit all origins under the DNS tab and that should bring you up.

You need to restart OpenVPN after the changes are done in order for them to apply to incoming connections.

1 Like

image

I would set above one to "No" or else the clients will get two DNS servers assigned.

1 Like

Finally! It's working! @deHakkelaar I already switched that option to 'No' when I reinstalled Pi-hole, but thanks!

@RamSet Again: thank you for your help! Finally managed to get it working! :slight_smile:

2 Likes

You are welcome :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.