Blocking ads only via vpn, not on home network

Expected Behaviour:

Queries are shown from all network devices, not only those via OVPN, just like they did before.

Actual Behaviour:

Pi-Hole's Query log only shows it's own queries (localhost) and queries from devices connected via OpenVPN, but not the queries from devices on my local network, despite the following facts:

  • In my router I configured Pi-Hole's IP as the Primary DNS-server (there's no option for secondary DNS-server).
  • If I check the DNS-address of my Android phone and Windows 10 notebook, they are automatically set to Pi-Hole's IP (confirming good router configuration, I assume).
  • It used to work in the last week (see below) and I didn't change router configuration.

If I generate a debug log (token below), I see

[i] Default IPv4 gateway: 192.168.2.254
   * Pinging 192.168.2.254...
[✗] Gateway did not respond.

However, pinging to 192.168.2.254 from my Raspberry Pi (with Pi-Hole on it) or my Windows notebook I do get responses.

Things I did the morning before I noticed that there were no queries from local network anymore:

  • sudo /usr/bin/sqlite3 "/etc/pihole/pihole-FTL.db" "delete from queries where domain='nas' and client='192.168.2.10';"
    and
    sudo /etc/init.d/pihole-FTL restart
    because my WD NAS (192.168.2.10 or http://nas/) did about 2 queries every second making a mess of my stats
  • Add 192.168.2.10 nas to /etc/hosts to find out if that would stop showing NAS queries to itself.
  • Block nas and whitelist it again.
  • Update gravity.

I already tried to fix the problem doing the following:

  • Restart Pi-Hole
  • Restart router
  • Delete 192.168.2.10 nas from /etc/hosts again
  • Restart FTL
  • Update gravity

Unfortunately I also flushed logs in order to see better if the problem still exists. Hope that doesn't make troubleshooting harder.

Pi-Hole and OpenVPN are configured following this tutorial.

Debug Token:

https://tricorder.pi-hole.net/5lfl6jiq15

Change the dnsmasq listening behavior via the web interface settings to listen on all interfaces.

Unrelated, you have PIHOLE_INTERFACE defined twice in /etc/pihole/setupVars.conf. Only the last entry counts and most likely the config was manually modified, which is not recommended.

1 Like

I did, but unfortunately it didn't help. As I recall correctly, this setting has always been Listen only on interface tun0 and it worked.

The tutorial (I mentioned) litteraly told to do so, but I can change it if that is better. Should I delete the first one?

By the way, I remember trying one other thing before it didn't work anymore: I filled Upstream DNS Servers Custom 1 and Custom 2, but now they are empty again.
Maybe this helps.

It definitely shouldn't listen on both interfaces (eth0 and tun0) if it is set to only listen on the one interface, so try changing it to one of the other options. Also check /etc/dnsmasq.d to see if there are any other non-Pi-hole configs which may be affecting the install.

Yes, delete the first entry.

It's still set to Listen on all interfaces and I deleted the first entry of PIHOLE_INTERFACE.

There was one extra config in /etc/dnsmasq.d/, this one is from the mentioned tutorial too. I disabled it, but it didn't fix my problem.

You should cross-reference what you did in that guide with the guide here: Redirecting...

I cross-referenced and changed some settings according to that guide, but couldn't find the solution.

I experimented myself with the various settings (mentioned in the tutorials). Now I have the following settings and both VPN and local network (without VPN) are routed via PiHole again :heavy_check_mark:

/etc/openvpn/server.conf
	push "route 192.168.2.0 255.255.255"
	push "dhcp-option DNS 192.168.2.11"

/etc/pihole/setupVars.conf
	PIHOLE_INTERFACE=eth0
	IPV4_ADDRESS=192.168.2.11/24

/etc/dnsmasq.d/01-pihole.conf
	interface=eth0

/etc/dnsmasq.d/02-ovpn.conf
	interface=tun0

Settings/DNS in the web interface is set to: Listen only on interface eth0.

I don't know what fixed it, but I'm happy again :slight_smile:
Thanks for your help!

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