Set up Pi-hole on your home network, enter custom DNS records, and save mental bandwidth by not remembering obscure IP addresses and ports.
If you read the previous post about setting up Tailscale to deploy a home server to the internet, you'll realize that when you want to access the server at home, your traffic is still routed through the VPN server, which increases latency and doubles the network usage of your home network. The correct solution is to use a local DNS server that will correctly route your requests to your LAN address.
Steps:
- Set up Pi-hole on your home network, either on a Pi, any system, or even the same home server you used in the previous step.
- Configure your router to use the Pi-hole as its DNS server.
- Configure Tailscale to use the Pi-hole as its DNS server.
- In Pi-hole, go to settings and local DNS, where you can create DNS records for your domain names and IP addresses.
Optionally, configure a reverse proxy manager on your home server (like Nginx Proxy Manager) to set up HTTPS and allow multiple services to run using the HTTP and HTTPS ports.
Links:
Other Thoughts
Also, instead of using a local IP address for DNS records, you can use the Tailscale IP address. Let me explain why I did this. I have multiple services running on my home server, of which I only want to expose 2-3 to the internet. All the other services I only want to access via my home LAN or through Tailscale when I'm on the go. Since my LAN and Tailscale IP addresses are different and I can't have the same domain pointing to two different IP addresses in DNS records, I must choose one, and I chose Tailscale. What that means is that I need to be connected to my Tailscale all the time (even when I'm at home) to use the domain names, but that's fine by me. I mostly just set Tailscale on and forget about it, as it doesn't interfere with any other network activity.