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

  • marud@piefed.marud.fr
    link
    fedilink
    English
    arrow-up
    5
    ·
    6 hours ago

    If you already have a domain name and don’t want to switch to something else, know that some DNS registrar have an API to handle the domains. For a short period of time I had to rely on this and had a little python script to get my current IP and apply it to every A record in my DNS zone.
    It worked well (but then I took an arrow in the knee had static IP)

    • tofu@lemmy.nocturnal.garden
      link
      fedilink
      English
      arrow-up
      1
      ·
      6 hours ago

      Yeah I still do this. I have a cronjob on one of my servers that runs every five minutes, checks if the upstream DNS IP matches my public IP and, if not, sets it. Adding 60s TTL, this means an average downtime of 3 minutes per change, max 6 minutes.

      It’s also possible to use different nameservers than the one the registrar provides, in case the registrar doesn’t have a proper API for DNS.