Skip Navigation

How to use a custom domain with Tailscale on a Synology NAS?

I've spent too many hours googling this stuff without a solution in sight that I'm able to understand.

I am moderately new to selfhosting, especially the networking aspect. To put it simply, all I want is to be able to access my services through Tailscale by using subdomain.mydomain.com.

I have gotten so far to point my domain to my Tailscale IP (using Cloudflare's DNS), so that I don't have to copy paste the Tailscale IP, but that means I still have to type in the ports to the services. Between the posts saying Tailscale can handle this, to the ones saying Synology can do it, and the remaining posts saying to use a reverse proxy (and the ones saying reverse proxy are a bad idea because of Synology stuff) I am now very lost. The terminology is exhausting and everyone is already so knowledgeable that they skip the basic steps and go straight to complex, short answers.

I'd like to keep using Tailscale, as I don't want to deal with security issues and SSL certificates and all that, and if possible I'd like to avoid using a reverse proxy such as npm or Caddy if there's a built in Tailscale/Synology solution that works.

To me more services just means more stuff that can break, and I really just want this stuff to work without fiddling with it.

Thanks for any help you can provide

18 comments
  • Wow the responses here are really off at the moment. I'm going to try and help.

    So, what you're going to want to do is add all the subdomain A records you need to you DNS (sounds like you're using cloudflare for that, not required, but that should be fine).

    Those DNS records are all going to be the same IP record, that's fine.

    What you need to do after that, so that you don't have to enter ports is a bit more complicated. For web servers, some kind of reverse proxy like nginx, haproxy, apache, etc is what you need. The term you're looking for is "virtual host".

    A virtual host setup is basically one where a reverse proxy looks at the domain name that was used to access the server over HTTP and then uses that to decide what server running on the machine you actually talk to.

    It's HTTP that actually is passing along the domain name you used, so if the service isn't HTTP you may or may not be able to do anything depending on the underlying protocol.

    So to recap:

    1. Set up your DNS records
    2. Set up an HTTP reverse proxy
    3. Add virtual hosts for each service you added a DNS record for to the reverse proxy (so that the reverse proxy can turn foo.example.com into example.com:xyz -- localhost:xyz in practice, morally example.com:xyz though -- behind the scenes)
  • Tailscale has a feature which assigns you a random network subdomain off ts.net. You can use it to find any system by name. But also you don’t need it. You can usually just access the services via the host name if your client is attached to tailscale and also has open ACLs for the services you are accessing. as far as i know there is no way to do what you are trying to do and I'm not sure why you are trying to do it. if you are trying to make a service public you probably want to use something like cloudflared instead.

    • If your goal is to expose a web server to the internet I recommend you use cloudflare zero trust and create a tunnel. This would solve any ssl certificate issues and would also get rid of the need to use any kind of reverse proxy as cloudflare would be acting as a reverse proxy. There are other options of course but this is the simplest for web based services.

      • If your goal is to simply be able to reach the NAS remotely over the internet you don’t need to open ports or use reverse proxies. You can simply access it internally via the tailscale grid just as if it were local to you like on a LAN. As long as your client is on the same tailscale net as the NAS and has open ACLs this will work fine. It’s sort of unclear to me as to what your actual goal is.

18 comments