General

Pi-hole + Tailscale

This might be the perfect Pi-hole setup!

Now when I am on the go not only can I access my home network with ease, I also get the ad blocking of Pi-hole wherever I am.

Updated November 2026: I went back through my own setup and found a few things in this post that were out of date or could trip you up (one of them was quietly still running on my network three years later). The steps below are the fixed version, updated for Pi-hole v6.

Here are the basic steps to get things set up. There are more configuration options for each piece, so please check their websites for full details before proceeding.

Step 1: Install Pi-hole

This can be done on a Raspberry Pi, in a VM, in a container, or on any server on your local network.

curl -sSL https://install.pi-hole.net | bash

Note:
In the Pi-hole admin page, go to Settings > DNS and under Interface settings select Permit all origins.

Tailscale traffic comes in on the tailscale0 network interface, not your local network, so this option is needed for Pi-hole to answer DNS questions from your Tailscale devices. It is safe for a Pi-hole inside your home network, as long as you have not forwarded port 53 on your router to it.

Step 2: Install Tailscale on the Pi-hole server

curl -fsSL https://tailscale.com/install.sh | sh

Step 3: Enable IP forwarding

This lets the server pass traffic along for other devices, which it needs to act as an exit node or share your home network (Step 4).

echo 'net.ipv4.ip_forward = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | sudo tee -a /etc/sysctl.d/99-tailscale.conf
sudo sysctl -p /etc/sysctl.d/99-tailscale.conf

The original version of this post wrote these lines to /etc/sysctl.conf. Newer systems (Debian 13, for example) no longer read that file at boot, so the setting quietly disappeared after a restart. The sysctl.d file above is what Tailscale's own docs use and works everywhere.

Step 4: Start Tailscale

First find your home network's range:

ip route

Look for a line like 192.168.1.0/24 dev eth0. That first part is your range. Then start Tailscale, replacing 192.168.1.0/24 with your own range:

sudo tailscale up --advertise-exit-node --advertise-routes=192.168.1.0/24 --accept-dns=false
  • --advertise-exit-node lets your devices send all their internet traffic through home when you want to.
  • --advertise-routes lets your Tailscale devices reach things at home that can't run Tailscale themselves (printers, the router's page and so on). If every device you care about runs Tailscale, you can leave it off.
  • --accept-dns=false keeps the Pi-hole from sending its own DNS questions to itself through Tailscale.

Don't copy the range blindly. I used 192.168.1.0/24 as the example in the first version of this post, and it turns out I had copied it onto my own servers, even though my home network uses a different range. It did nothing useful at home, and on any other Wi-Fi that happens to use 192.168.1.x (hotels, friends' houses) it could send my laptop's local traffic back home instead. Oops.

The first version also had --accept-routes=true on this command. I've removed it: the Pi-hole server is already on your home network, so it doesn't need routes to it, and accepting a route to its own network can break its local traffic.

Step 5: Set up Tailscale's admin console

Log in to the Tailscale admin console and find the Pi-hole on the Machines page. From its three dots (…) menu:

  1. Select Disable key expiry. Since the Pi-hole is not directly exposed to the internet, it is safe to not require re-authentication.
  2. Select Edit route settings... and approve both options: Use as exit node and your home network range. See image below.

Next, copy the Pi-hole's Tailscale IP address (it starts with 100.). On the DNS tab, add it under Global nameservers and turn on Override DNS servers. See image below.

Also turn on MagicDNS on the DNS tab. It lets you reach every device on your Tailscale network by its name (for example pihole instead of 100.101.102.103) while you're connected to Tailscale.

Tip: run two Pi-holes. If your only Pi-hole goes down, every Tailscale device loses DNS, which looks exactly like "the internet is broken". If you have a second machine, put Pi-hole and Tailscale on it too and add its Tailscale IP as a second global nameserver. I run one in a Proxmox container and one as an app on my NAS.

Step 6: Point your router at Pi-hole

In your router's settings, set the DNS server to the Pi-hole's local IP address (add both if you have two). This covers everyone on your home network, even devices that aren't on Tailscale. Pi-hole has instructions for common routers.

Step 7: Teach Pi-hole your device names

Out of the box, Pi-hole doesn't know the names of the machines on your network, so things like nas or server.lan won't work. The fix: in the Pi-hole admin page, go to Settings > Local DNS Records and add each server's name and local IP address (do it on both Pi-holes if you have two). Give those devices reserved addresses in your router so the list doesn't go out of date.

Pi-hole also offers Conditional forwarding (asking your router about names it doesn't know), but skip it if your router uses Pi-hole for DNS like in Step 6. The two end up asking each other, and a mistyped name bounces back and forth until it times out.

Step 8: Install Tailscale on your other devices

Install Tailscale on your phone, laptop and anything else, and sign in to the same account.

That's it!

Now when you're connected to Tailscale you get ad blocking everywhere, even when you're not at home, plus access to your home network.

AI Disclosure

This project was created with the help of AI.

Links