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

Update: after reading the comments the two main options I’m considering now are either a cheap VPS to use as proxy for my network via wireguard, or DynamicDNS. I’ll see if I can figure out the rest from here, thank you!

  • imetators@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 hours 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.

  • IronKrill@lemmy.ca
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 hours 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.

  • mic_check_one_two@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    8
    ·
    11 hours 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
      1
      ·
      10 hours 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)

      • mic_check_one_two@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        1
        ·
        6 hours ago

        Yeah, I personally prefer to keep things running fairly light. I’m not running a 99.9% uptime server with hundreds/thousands of users, so I can tolerate a 0-5 minute downtime every few days.

  • UnpledgedCatnapTipper@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    12
    ·
    18 hours 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.

  • Svinhufvud@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    10
    ·
    19 hours 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.

  • fozid@feddit.uk
    link
    fedilink
    English
    arrow-up
    19
    ·
    23 hours ago

    I’ve had a domain with a dynamic up for over a year with no problems. I have a simple script that runs every 30mins to check if my IP has changed, then updates the DNS records when required.

    • cmnybo@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      15
      ·
      1 day ago

      One of the better free options is FreeDNS, but you are limited to 5 records.

      If you want your own domain, I would suggest Porkbun. They have an API that can be used for dynamic DNS.

      • Bakkoda@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        21 hours ago

        I have used FreeDNS for so long I don’t remember and never ever had a problem. I have a few domains i don’t even use set to public as well.

  • qjkxbmwvz@startrek.website
    link
    fedilink
    English
    arrow-up
    8
    ·
    20 hours 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
        2
        ·
        15 hours 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.

  • Encrypt-Keeper@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    15 hours 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?

  • TrippinMallard@lemmy.ml
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    17 hours 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.

  • Bakkoda@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    21 hours ago

    I’ve been self hosting for 20 years with the same domain(s) and have never owned a static IP. Use a reliable DNS service with simple update tools (curl on a cron job for example).

  • cecilkorik@piefed.ca
    link
    fedilink
    English
    arrow-up
    5
    ·
    19 hours ago

    You don’t have any great options but you do have some options. You’ll need dynamic DNS, which you can get for free by various providers. This will manage a “dynamic” DNS entry for your occasionally changing, non-static IP at home. The dynamic DNS entry won’t be on your own domain name, it will be on the provider’s domain name. But wait! That’s just step one.

    You can still get your own, fully-functional domain name, and you can have all the domains and subdomains you want, and set them up however you want, with one important restriction: You can’t use IP addresses (because yours is dynamic, and changes all the time and you would have to be constantly updating your domain every time it does, and there would be delays and downtime while everything gets updated).

    Instead, your personal domains have to use CNAME records. This substitutes the IP from a different domain INTO your domain. So you CNAME every entry on your own fancy domains to point at your dynamic DNS provider, which manages the dynamic part of the problem for you and always gives the real IP you need. Nobody sees the dynamic DNS name, it’s there, but it’s happening behind the scenes, they still see your fancy personalized domain names.

    It’s still not going to be perfect, it won’t work well or at all for certain services like email hosting (self-hosting this is not for the faint of heart anyway) that are very strict about how their DNS and IP addresses need to be set up, but it will likely be good enough for 99% of the stuff you want to self-host.

  • Ada@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    12
    ·
    1 day ago

    Our setup uses a domain pointed at a dynamic (but stable) IP with a script to update it periodically