You've your Pi-Hole installed on your personal network, but you want to use it outside of your home? If that's the case stick with me and follow this tutorial that will explain to you how to integrate your Pi-Hole with Zerotier, an easy virtual network accessible from anywhere around the world where all traffic is encrypted end-to-end!
Advantages of using Zerotier instead of a traditional VPN
- Zerotier works even on your personal network so you won't have to change your DNS settings nor connect to your VPN every time you leave your house.
- You can still use the existing Internet connection that you are using outside of your house instead of routing your current Internet connection trough your home network like you would with PiVPN and thus losing some bandwidth if your home connection is not powerful enough.
- You don't need to set up a dynamic DNS nor having a static IP nor configuring the port forwarding because Zerotier will do all the job for you to automatically setup the best configuration according to your network.
- Zerotier works out of the box in every network environment (unless the administrator explicitly ban Zerotier servers), even on very restrictive network that allow only HTTP and HTTPS (proof here).
Requirement
- An already installed Pi-Hole server
Tutorial
First part : Configure Pi-Hole on your Zerotier Network
- Create an account on the Zerotier website: ZeroTier Central
- After creating your account head over the network section: ZeroTier Central and then click on the
Create Network
blue button. - A new network should come up:
- Click on the new network and then let the page opened you will need the network ID just after a couple of steps:
- You may want to change the name of the network and the
IPv4 Auto-Assign
to numbers that are easier to remember, for example:192.168.192.*
:
- Open an SSH connection to your Pi-Hole server and then install Zerotier using this command:
curl -s https://install.zerotier.com/ | sudo bash
- When you get this message:
Success! You are ZeroTier address
. You are ready to join your virtual network using this command:
sudo zerotier-cli join network_id
You need to replace network_id
with the Network ID specified on the Zerotier Central page that you opened a minute ago.
- Then you should get a success message:
200 join OK
, if that's the case return on the Zerotier Central page. - Scroll down until the
One device has joined this network.
message. - You will now need to accept your Pi-Hole server to join the network by checking the box just below the
Auth?
:
- Then wait a bit until the red line switches to green and that you get a third IP in the
Managed IPs
column.
- Give a name to your Pi-Hole server in the
short name
field. - Change the IP of your Pi-Hole server in the
Managed IPs
column to numbers that are easier to remember, for example mine is192.168.192.1
because the network is set to192.168.192.*
inside theIPv4 Auto-Assign
box. Don't forget to delete the old managed IP.
- Open a page to your Pi-Hole DNS Settings: http://pi.hole/admin/settings.php?tab=dns
- Check the
Listen on all interfaces
box to allow the devices from your Zerotier Network to use your Pi-Hole and then save:
- That's it you now have configured your Pi-Hole server with Zerotier!
Second part: Configure your device(s) to use your Pi-Hole trough your Zerotier Network
Windows (7, 8, 8.1 and 10)
Setup Zerotier
- Install the Zerotier application: https://download.zerotier.com/dist/ZeroTier%20One.msi (don't uncheck the
Start Zerotier
at end the of the installation). - A
Zerotier One
window will come up, you have to login with your account. - You will then be greeted to join a network you just have to join your network:
- Click on
done
and then accept the new blue network window on the right if you are on Windows 8/8.1/10.
Change the DNS servers
I won't explain to you in details how to change your DNS servers because there are already loads of tutorials on the Internet to guide you but here is a good tutorial to help you: How to Change DNS Servers in Windows
At the configuration of the IP of the DNS server, 11th step if you followed the tutorial that I linked, you have to enter the managed IP (Zerotier) of your Pi-Hole server (available on the Zerotier Central page).
If you have followed the first part to the letter please make sure to enter 192.168.192.1
and having a similar result as mine:
Android
Setup Zerotier
- Install the Zerotier One app from the Google Play Store: https://play.google.com/store/apps/details?id=com.zerotier.one
- Run it and then tap on the
+
button right top side of the app:
- Enter your Network ID and then check the "Use Custom DNS servers" box:
- Enter the managed IP (Zerotier) of your Pi-Hole server in the first IPv4 DNS field and then tap the "Add Network" button:
- Return on the Zerotier Central page.
- You will see a new device that has a red vertical line, you just have to do the same thing as the first part click on the box in the column
Auth?
to allow the device to join the network. - Now you are ready to initiate the connection on the Zerotier One app on your Android device by activating the slider inside the network box:
Linux (Ubuntu, Linux Mint, Fedora and more)
Setup Zerotier
The installation of Zerotier on Linux is very similar to the first part. You just have to follow from the 6th step to the 10th step.
Note to ArchLinux users. There is an official package for Zerotier: https://www.archlinux.org/packages/community/x86_64/zerotier-one/
Change the DNS servers
Configuring the DNS servers on Linux highly depend on the graphical interface, but here are anyway some tutorials for the popular Linux distributions:
- Ubuntu: https://vitux.com/how-to-change-dns-settings-in-ubuntu/
- Linux Mint: https://support.opendns.com/hc/en-us/articles/228007167-Linux-Mint-Cinnamon
- Manjaro: https://wiki.manjaro.org/index.php?title=Set_DNS_or_Nameservers
At the configuration of the IP of the DNS server enter the managed IP (Zerotier) of your Pi-Hole server, if you have followed the first part to the letter please make sure to enter 192.168.192.1
.
MacOS
Setup Zerotier
I don't personally own an Apple device but it's possible to install Zerotier on your Mac by installing the .pkg
available on the Zerotier's download page: https://www.zerotier.com/download.shtml (Apple Macintosh
).
If you need some help here is a good tutorial that I found on the Internet: https://www.stratospherix.com/support/setupvpn_02a.php
Change the DNS servers
Here is a tutorial to help you change the DNS servers on your Mac: https://serverguy.com/kb/change-dns-server-settings-mac-os/
At the configuration of the IP of the DNS server enter the managed IP (Zerotier) of your Pi-Hole server, if you have followed the first part to the letter please make sure to enter 192.168.192.1
.
iOS (iPhone / iPad / iPod Touch)
Setup Zerotier
You can install Zerotier on your iOS device by installing the official app from the App Store: https://itunes.apple.com/us/app/zerotier-one/id1084101492?mt=8
If you need some help here is a good tutorial that I found on the Internet: https://www.stratospherix.com/support/setupvpn_03.php
Change the DNS servers
Here is a tutorial to help you change the DNS servers on your iOS based device: https://appleinsider.com/articles/18/04/22/how-to-change-the-dns-server-used-by-your-iphone-and-ipad
At the configuration of the IP of the DNS server enter the managed IP (Zerotier) of your Pi-Hole server, if you have followed the first part to the letter please make sure to enter 192.168.192.1
.
I hope you liked my tutorial, please don't forget to up vote the post on Reddit & like this post on the forum and leave a feedback in the comments!