How to easily use your Pi-Hole outside of your personal network

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?

Sorry for my very late reply.

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.

2 Likes

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

Tried a couple of guides but didn't work

Thank you for your feedback! I really appreciate.

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 :smiley:: https://my.zerotier.com/community.

1 Like

Thanks, tried, but no answer, probably because they do not have a proper forum,

A post was split to a new topic: Zerotier + Pi-hole not working

After the step of connecting my pi to the zerotier network it lost internet connection

Do all the right thing but my phone could not ping the pi hole, both joined the network though.
Using iphone 7 plus, ios 12.3.1

This is wonderful, I used this setup and the performances really impress me, considering that my home connection is very limited.

Thanks for sharing it!

Thanks for the guide :+1:

1 Like

This really is awesome, I am so glad I ran into this post. Thanks so much for it.

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.

1 Like

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.

neofetch

██████████████████  ████████   soumi@Hori 
██████████████████  ████████   ---------- 
██████████████████  ████████   OS: Manjaro Linux x86_64 
██████████████████  ████████   Host: Aspire A514-53 V1.16 
████████            ████████   Kernel: 5.15.7-1-MANJARO 
████████  ████████  ████████   Uptime: 3 hours, 15 mins 
████████  ████████  ████████   Packages: 1375 (pacman), 11 (flatpak) 
████████  ████████  ████████   Shell: zsh 5.8 
████████  ████████  ████████   Resolution: 1280x720, 1280x720 
████████  ████████  ████████   DE: Plasma 5.23.4 
████████  ████████  ████████   WM: KWin 
████████  ████████  ████████   Theme: Breath2 2021 Light [Plasma], Breeze [GTK2 
████████  ████████  ████████   Icons: [Plasma], breeze [GTK2/3] 
████████  ████████  ████████   Terminal: terminator 
                               CPU: Intel i3-1005G1 (4) @ 3.400GHz 
                               GPU: Intel Iris Plus Graphics G1 
                               Memory: 5781MiB / 7626MiB

the only issue I had with this tutorial is the ip address assignment for the pihole. It's should not 192.168.192.1

it's the gateway address of the network. I change it to 192.168.192.10 and all device pointing to that IP and it works

Thanks for Posting this lovely guide, I accomplished it mostly the same way.

Just some Additions to your guide for 2022:

  1. You only seem to get a total of 2 Managed IPs (atleast i got just 2), but it still properly works, so dont wait for a 3rd one.
  2. In the Zerotier One App (Andoird), you have to go to Settings and check "Use Cellular data" to connect to the mobile internet

Best Regards

The "Listen on All Interfaces" does not show on my PiHole Settings.

Should one of these be selected?

When the above articles were written it was worded as Listen on all interfaces, permit all origins. Now it's worded as Permit all origins.

1 Like