Please follow the below template, it will help us to help you!
If you are Experiencing issues with a Pi-hole install that has non-standard elements (e.g you are using nginx instead of lighttpd, or there is some other aspect of your install that is customised) - please use the Community Help category.
Expected Behaviour:
I'd like to be able to set up pihole as DNS for machines in local network and use wireguard vpn on mobile when I'm outside local network.
Raspberry pi 4B, raspbian 10, pihole 5.1 with pivpn and wireguard.
Actual Behaviour:
VPN works amazing - I see queries in query log, ads are filtered. I can't set pihole as DNS for machine. Internet stops working.
So as mentioned above pihole works like a charm over vpn, but it stops working when I try to set it as dns on both my laptop with ubuntu 18.04 and phone with miui 11.
In this configuration I have access to the internet, but nothing appears in the query log. I can't access pi.hole/admin. 192.168.1.12/admin works.
I removed one line from /etc/dnsmasq.d/02-pivpn.conf and rebooted the pi. Dns over vpn works, but I still can't set pihole as dns in local network. Now I can't access internet even with automatic dns turned on in network manager. Something changed !
Check that line doesnt return after a reboot!
Post results for below ones run on Pi-hole , and on one of your clients in a cmd prompt (Windows/Linux/MacOS):
nslookup pi.hole
nslookup pi.hole 192.168.1.12
EDIT: ow and check if your router doesnt have some kind fo rebind protection or similar:
EDIT2: also check if firewall is blocking on Pi-hole:
Try ditch that 02-pivpn.conf file.
Its foreign to Pi-hole (doesnt come with Pi-hole install) and probably contains more settings that could cause troubles:
You should specify the DNS server to query with nslookup:
nslookup <DOMAIN> <DNS_SERVER_IP>
If you leave out the <DNS_SERVER_IP> , nslookup will use/query the DNS server(s) configured in the OS.
When on LAN client, you query the LAN eth0 IP.
When on VPN, you query the wg0 interface IP.
Hi,
not sure when, but pihole started working.
I'd assume that setting interface to the correct one (in my case wlan0) and removing unnecessary files did the trick.
Maybe my pc/router cashed some settings and that's why it took a while for the changes to show ?
Anyways, thanks a ton for help !
output of nslookup seems to be fine (I have dns server set up in network settings, so there seems to be no need to add it to the command):