Hey everyone. This is probably a super noob question, but I’m very much just an amateur when it comes to self-hosting.

I host several services that I access locally through 192.whatever:####, and when I occasionally need remote access, I use Tailscale and access through 100.whatever: ####. The duplicate bookmarks is mildly annoying though.

Can I just buy a personal domain, and have all my services be coolname.com:#### for both local and Tailscale access? Is that as simple a process as I want it to be?

Edit: I appreciate all the comments and I’ll probably just use Tailacale’s MagicDNS for simplicity, but one or my (unwritten, my bad) goals was to have one URL that works locally and remotely, regardless of Tailscale. I don’t leave Tailscale constantly connected because it overheats my phone (which already has terrible battery life).

  • lemmyvore@feddit.nl
    link
    fedilink
    English
    arrow-up
    7
    arrow-down
    1
    ·
    edit-2
    7 hours ago

    Can I just buy a personal domain, and have all my services be coolname.com:####

    It’s actually better. If you get a domain and install a reverse proxy on the server (Nginx Proxy Manager is easy to use) it will help you get free SSL certificates and make subdomain “aliases” so you’ll be able to use https://service.coolname.com/ links. And they’ll have the little shield in browsers and everything.

    To get the SSL certificates you’ll need an SSL service with an API and access tokens. Most domain registrars are not this fancy unfortunately, but you can delegate your nameservers to a (free) service that can do that. DeSEC.io is a good choice.

    You only need this DNS provider to verify the ownership of coolname.com. You do NOT need to put any IP in there.

    for both local and Tailscale access? Is that as simple a process as I want it to be?

    The Tailscale access is a bit more involved. Here’s the general steps:

    • Get Tailscale running on the server with all the services and the reverse proxy. Tailscale will create a network interface with a 100.64.x.x IP address.
    • Have the reverse proxy listen on all server interfaces including that 100.64 IP. Generally this should happen automatically. You should be able to see the reverse proxy admin page at http://100.64.x.x:8081 (or whatever the admin port is) as well as at http://[lan ip of the server]:8081.
    • In order to reach the reverse proxy over the LAN when you type service.coolname.com you will need to tell your LAN DNS server to resolve *.coolname.com to the LAN IP of your server.
    • Next you need to install a small DNS server but this one has to listen only on the Tailscale IP. Dnsmasq is a tiny server you can use for this. You want to configure it to resolve *.coolname.com to the Tailscale IP (100.64.x.x).
    • Then you go to the Tailscale admin page under the “DNS” section, click on “Add nameserver”, choose “Custom nameserver”, put in that Tailscale IP, check the “Restrict to domain” box and put “coolname.com” in there.

    After that, when you’re at home but NOT connected to Tailscale you will have coolname.com pointing at the reverse proxy via the LAN IP, and when you ARE connected to Tailscale (whether at home or not) it will be pointing to the Tailscale IP and go through the Tailscale VPN. So you’ll be able to use https://service.coolname.com/ all the time everywhere.