Blocking Everywhere

Building on the idea to have a pihole in the sky, having a Pihole that I can use all the time was appealing. It’s also extremely important to consider that cellular providers don’t allow a change of DNS service so adverts and intrusions would be happening on those networks.

This is no longer the case. Thank you again, Tailscale!

It’s not so complicated to set up; firstly, Tailscale on the DNS host needs to be configured so that it does not ask itself for DNS – if it did that, DNS would not resolve.

Drop the service and restart is, blocking inbound DNS from itself.

sudo tailscale down
sudo tailscale up --accept-dns=false

That’s 50% of the complicated task done…..

In the Tailscale admin console, copy the Tailscale IP address of your Pihole server to your clipboard. While you’re there, disable Key Expiry to avoid the service suddenly stopping…!

Visit the DNS tab in the console and add a custom nameserver – paste the IP address into that field and toggle the switch to Override local DNS.

You will see the hosts begin to use your Pihole immediately. If you’re lazy, you can stop now – you have completed the steps necessary to use the Pihole everywhere.

For those who are meticulous and want to know the hostnames rather than just IPs that use the service, there is a small step to perform. In the Tailscale admin console tab for Machines, there is a download icon at the top-right, level with the filter box. Click it!

The file downloaded is a CSV file which will need some adjusting – the contents will be pasted into the hosts file so needs to be IP <gap> hostname in format and order. A little flicking between Excel and Notepad, some moving of columns and CTRL-H work will see the content ready for the hosts file. Open it for your paste action:

sudo nano /etc/hosts

Once the contents are pasted into the hosts file and saved, either restart the Pihole or visit the Settings page and flush the network table. The new entries should then have a hostname in the column.

NB: This can also be done for a locally-hosted Pihole, either on a Raspberry Pi or other host.