Skip Navigation

Dynamic IP - Self hosting

Im sure this has been asked before i juat can't find where it has been - Maybe need to work on how to search Lemmy better. But...

Id like to eventually self host some sevices that require external access. While I have IpV6 addresses my IPV4 is dynamic.

Whats the best free way to be able to point some domains/ subdomains I have to my external dynamic IP and keep it updated. Im running OpenWrt on my router. - So possibly should be posting there.

Free Dyndns services seem to be a bit crap. Do I need to pay for a VPS? (seems to defeat the point of self hosting)

61 comments
  • Many DNS providers have an API and are supported by various dynamicDNS clients. I use Cloudflare and the built in client on my Opnsense router.

    OpenWRT should have a client too that supports a bunch of services.

  • I'm using cloudflare as my nameserver and the free API seems to work just fine with ddclient.

  • There are two options, one is tunneling (e.g. tailscale, cloudfare tunnels, or a VPS either with special software or plain old SSH port forward constant connection). The other option, the most popular answer (I think, influenced by how yoy asked) is Dynamic DNS or DynDNS (e.g. duck, hurricane, freedns, etc.) this second one is like the classic solution.

  • If you go down the VPS route, a headscale server on a cheap $3.50 VPS would be the way to go. Wouldn't even have to deal with IP addresses at that point, while still being able to self-host all your services, with the cheap VPS being a glorified switch/firewall.

  • Cloudflare has an api for easy dynamic dns. I use oznu/docker-cloudflare-ddns to manage this, it's super easy:

     undefined
        
    docker run \
      -e API_KEY=xxxxxxx \
      -e ZONE=example.com \
      -e SUBDOMAIN=subdomain \
      oznu/cloudflare-ddns
    
      

    Then I just make a CNAME for each of my public facing services to point to 'subdomain.example.com' and use a reverse proxy to get incoming traffic to the right service.

  • You can pay for dyndns service which should be more reliable than free ones. I don't have any experience with those, so I can't give any recommendations. What I'm running is that I use few of the free ones which are updated either from my router or from a linux VM and I've just pointed few easy to remember CNAME records from my own domain to those dynamic addresses. It's not the best thing in the world, but my dynamic IP tends to be pretty static as it usually changes only when my own hardware is down for a longer period of time (few hours or so, so a longer power outage or a hardware maintenance gone wrong).

61 comments