Maybe I'm wrong, but I think the above configuration doesn't work while on a cellular connection. On mobile devices you can change the DNS server for a WiFi connection, but not for a cellular connection.
While joining a ZeroTier network there is also an option "Use custom DNS Servers" in the client. What if we enter the Pi-hole IP address there?
According to a reddit user, it's possible to use your pihole trough zerotier on a cellular connection.
Like you said you need to set "use custom DNS Servers" to the IP of your pihole server assigned in zerotier network.
EDIT: I just updated the tutorial with this new setting so if you refollow the Android section it will work even on a cellular connection.
Fantastic guide. Works perfectly.
Now I wish that from outside my network I can access all devices (beside 192.168.192.x that have Zerotier installed) also those 192.168.1.yyy
I haven't setup a way to access my LAN from Zerotier yet, so I won't be able to help you but you could ask on the Zerotier's community forum for some help : https://my.zerotier.com/community.
Hey thanks for the guide! Unfortunately I tried this multiple times now and it never worked. I am a little lost on what to do... I never managed to make a client forward a dns request through zerotier. Whenever I activate it on my phone it just loses internet connection and my windows computer too.
I made sure I followed your steps very precisely so I wonder what is missing?
I am using pi hole on fedora, android and windows 10.
what is the advantage of this method then accessing home network via wiregaurd/openVPN? only limitation with later method is open port on router for VPN?
Thanks a lot for that. This is exactly what i was looking for, with my isp cgn this the only working guide and it is way faster than other vpn methods.
Btw did you find a way to connect to other devices on the lan without ZeroTier installed?
The issue I am facing:
I installed the pi-hole on my raspberry pi with success and configured the DNS servers to use my rpi to route all traffic through the pi-hole. Details about my system:
When following this post: ZeroTier
to connect the zero tier network to pi hole with the mentioned routing rules. The routing through zero-tier network works, but the problem is, that the routing without connected to zero-tier (only through eth0) does NOT work anymore and no blocking of adds when connected without zero-tier is done, which was previously working well, when connected to my LAN network through eth0 or wlan0.
Q: How can I add/change the routing rules so that, pi-hole blocking would work when routing traffic through zero-tier tunnel AND through eth0, when NOT connected to zero-tier network. What I have changed since installing Pi-hole:
PHY_IFACE=eth0; ZT_IFACE=ztly547uhs
sudo iptables -t nat -A POSTROUTING -o $PHY_IFACE -j MASQUERADE
sudo iptables -A FORWARD -i $PHY_IFACE -o $ZT_IFACE -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i $ZT_IFACE -o $PHY_IFACE -j ACCEPT
including these rules enables connection from zero-tier network to my LAN, but breaks the direct eth0, wlan0 add blocking, which was working previously?
Kind regards, Peter
Is there any way to use this on docker? My pi-hole runs on docker because I am running Manjaro, and docker is the only way to get it running. I only have 1 laptop so using another device to host pi-hole is not an option for me.