I’ve been thinking about finally getting myself a proper domain for my server, but a friend told me that to get one I either need a VPS with a public ip (which just takes all the fun out of selfhosting) or purchase a static ip, which is beyond what I’m willing to spend for a hobby. Do I have any good options or should I just let it go?

Also, if this isn’t the correct community for this, I’d appreciate being pointed to the right one, thank you

  • TrippinMallard@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    2 months ago

    You can use Netbird Cloud’s reverseproxy to point your domain to a device on your wireguard mesh.

    That way your home server can be under 3x NATs and dynamic IP and you’ll still be fine.

    Later if you want to own the netbird you can self host it on a VPS if you’re willing to migrate all devices to your self hosted wireguard mesh.

  • qjkxbmwvz@startrek.website
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    VPS with a public ip (which just takes all the fun out of selfhosting)

    Why do you say this? My VPS only runs a reverse proxy and WireGuard, with all services hosted on my computers at home.

      • qjkxbmwvz@startrek.website
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        Cool, I recommend it!

        I have my public facing reverse proxy point to my public services, and I also have it set up as a “roadwarrior” VPN to my home. So, I can connect my phone via WireGuard to my VPS, and a local DNS resolves my private services to the private IP addresses in my home network (so, I also run a reverse proxy on my server, for internal services).

        I also have an off-site backup using this — just a raspberry pi and an HDD at family’s, that rsyncs+snapshots over the WireGuard network.

        I’m sure I’m not following all the best practices here, but so far so good.

  • Svinhufvud@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    It is very much possible to have a dynamic IP and a usable domain.

    Both Cloudflare and desec.io (for example) have APIs that you can hit everytime your public IP changes.

    I have a script that checks every minute whether my public IP has changed from the last check, and if it has, an API call will be sent.

    With a scheme like this, your downtime will be minimal, if ever even noticed.

  • nikki@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    i have a little program for dynamic dns running in docker that checks every few seconds for an IP change and swaps my DNS records if it gets rerolled.

    works well on my home network, I can use my domain for all my private services local and remote through wireguard :)

  • UnpledgedCatnapTipper@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I run a variety of self hosted things via my domain on a dynamic IP. I just have dynamic dns set up to check my current public IP periodically, and update the dns entry if it changes.

  • Brickfrog@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    but a friend told me that to get one I either need a VPS with a public ip (which just takes all the fun out of selfhosting) or purchase a static ip

    Neither of those are requirements. Just buy a domain at a registrar that allows you to dynamically update an IP address with a domain you have there. Look into DDNS update scripts and/or your own internet router, many routers have that feature built-in already.

  • Encrypt-Keeper@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    What are you asking? You can just buy a domain whenever you want. You can use it on your server without a VPS or static IP.

    Are you asking us how to make your services reachable at that domain publicly over the internet?

  • entheo@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I believe cloudflare has some sort of tunneling option but I’ve never really looked into it, it might get around that.

    • Dave@lemmy.nz
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      It does, yeah. If you aren’t averse to cloudflare then it’s a great option.

      From memory I think it’s limited to http/https traffic, but that’s normally not an issue, just have all your services behind a reverse proxy.

  • grue@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    I have a domain, but all I use it for so far is email (with an email provider, not my own mail server, hosted locally or otherwise). I’d still call that “usable,” though.

  • mic_check_one_two@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    What you’re looking for is called Dynamic DNS. I use Cloudflare for my DNS (which feels a little like making a deal with the devil) and Cloudflare-DDNS to automatically update my DNS records when my WAN IP changes. Basically, the container checks the current WAN IP, checks the current Cloudflare DNS records, and pushes a change if they don’t match. It runs every few minutes, and then rests again until the next check. I’m sure other DNS providers have similar ways to set up DDNS.

    It’s not a 100% foolproof thing, because your WAN IP changing will take a few minutes to update. But a few minutes of downtime is much better IMO, when the alternative is needing to manually VPN into my server (if the VPN even still works, since the WAN IP changed), and troubleshoot it every time the IP address changes.

    • Joelk111@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      You can configure it to run as often as you want (well, I’m not sure about cloudflare, but with other services you can, like DuckDNS)

  • IronKrill@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    My dynamic IP rarely changes. When it does, it gets updated by a Docker favonia/cloudflare-ddns image. I have yet to notice downtime.

  • imetators@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    My ISP changes IP somewhere around once a month. I own a domain on porkbun and they offer a simple docker compose script that updates my records to a current IP.

    I believe other domain selling platforms also have similar scripts or solutions.

  • lavander@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    You need static IP only if you want to host the autoritative DNS server for your domain (spoiler alert: you don’t).

    You don’t need to proxy your traffic via VPS (higher latency for no good reason) and the dyndns providers are over priced.

    What you need is:

    • Buy your domain
    • Use a free DNS provider (I used for years the excellent dns.he.net but it is a bit cumbersome. Nowadays I gave up and I now use cloudflare without any proxying, just pure DNS)
    • Point your registrar to the dns provider
    • use ddclient to update the IP of a domain entry (e.g. server.example.com)
    • add as many CNAME as you want that point to that entry (so you can have stuff like Jellyfin.example.com www.example.com Nextcloud.example.com)

    That’s all… ddclient will update that single dns entry every time your server restarts (or the IP lease expires and you get a new IP)

    The only thing you need to pay here is the domain (you can get free domains but that is another story and tbh I would not recommend, there are cheap domains out of there)

    • Everyday0764@lemmy.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      mhh I don’t think this works behind cgnat…

      it works if you have a dynamic public ip. Where I’m from, generally, they give you a natted ip.

      • lavander@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        For sure, you need a public (dynamic) IP for this.

        NAT sucks, been there, done that… ugh! And, yeah, nothing can be done short of some sort of proxing that adds latency and unreliability