How to access Yunohost apps using Tailscale MagicDNS

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: 12.0.16
How are you able to access your server: The webadmin
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: No

Describe your issue

I am connecting to my Yunohost instalation in a home Rasperberry Pi using Tailstcale magicDNS (eg. “raspberrypI[DOT]bird-tail[DOT]ts[DOT]net”). I currenty have 2 apps installed in Yunohost (eg. “app1” and “app2”).

I have added the “raspberrypi[DOT]bird-tail[DOT]ts[DOT]net” domain in Yunohost admin and I can reach it via this tailscale address but I need a way to access directly each of the apps.

I have tried adding a prefix to the subdomain (“app1[DOT]raspberrypi[DOT]bird-tail[DOT]ts[DOT]net” and “app2[DOT]raspberrypi[DOT]bird-tail[DOT]ts[DOT]net”) but I don’t know how to make yunohost redirect these requests to the corresponding apps.

Can someone help?
Thank you.

Share relevant logs or error messages

General dns error

There are two ways:

  • installing or moving each app to a path: app1 at raspberrypi.bird-tail.ts.net/app1 and app2 at raspberrypi.bird-tail.ts.net/app2

  • adding app1.raspberrypi.bird-tail.ts.net to YunoHost domains and installing or moving the app to this domain. Same for app2.

Thanks for reaching out. I have already tried both: #1 is not possible because the apps require to be installed in the domain root (grist and n8n) and I tried #2: the app is apparently moved to that sub-sub-domain but the app is not found afterwards. I am not sure if I need to change something in Yunohost or Tailscale but Tailscale finds Yunohost admin. And if I install one app to the same Tailscale domain (without “app1”) the app does work. But that means I can only have one app running. Bottomline: I think it is a redirecting issue that I need to address in Yunohost.

Tailscale works with hostname and not domain name, right ?

It gives several options, but domain name via magicDNS is one of them. I can access yunohost admin if I configure it to use Tailscale domain.

It seems that ‘‘domain name’’ means ‘‘hostname+tailsdomain.tld’’. So you can reach main domain but no others. Can you set a ‘‘custom’’ DNS in tailscale?

This guide might help you:

You should be able to use e.g. app1.yourtail.internal

Thanks, I will check the info. It must really be a routing issue I guess. But now I am not sure if it’s a limitation in Tailscale. Will check.

Maybe I can use PiHole with tailscale and use it as dns. I was doing it via openVPN previously. Will check

Don’t use Pihole because it’s no longer supported (on Yunohost at least), but you can use Adguard Home, or Technitium DNS.

Thanks for the suggestion. Will check it out asap, meawhile, got it working with PiHole (I’ll post the how-to) because I have it already installed and been using it for a few years.

In case anyone has this requirement, here’s how I’ve done it. This article pointed me to the right solution: Block ads on all your devices from anywhere using a Raspberry Pi · Tailscale Docs

Basically I’ve added a custom nameserver in Tailscale admin pointing to the machine where I had PiHole running (100.x.x.x). Then, in PiHole admin I added Local DNS records (app1.local, app2.local) and pointed them to the IP of the other machine hosting Yunohost (100.x.x.x).

Then, in Yunohost admin / Apps, I’ve chosen to serve each app from the respective local domain (app1.local, app2.local).

Now, using Tailscale, I can reach each Yunohost app and get ad blocking. Each DNS query goes to PiHole, gets blocked for ads, and then checked if it should resolve to a local machine (i.e. the apps installed in Yunohost) or the broader internet.

Thanks everyone!

:+1:

Great that you could solve it! just be aware that PiHole won’t have updates in Yunohost, and also I don’t know if you managed to use self-signed certs in case you need https, in that case it’s always a good idea to use “.internal” instead of “.local”

1 Like

I guess he runs pihole on a dedicated server, otherwise, the problem would be the same.

yes, been using it on a raspberry pi.