Cloudflare DDNS Setup on SCALE 24.10.2

I am following a guide on how to set up nextcloud on my TrueNAS SCALE system. The step I am on right now requires me to have set up the DNS records of my domain to point to my server, and since I don’t have a permanent public IP, I need to set up a Dynamic DNS method.

From what I have been able to understand, Cloudflare doesn’t really have support for DDNS, instead offering some hacky workarounds such as third-party clients or creating a script to make calls to their API to edit the domain’s DNS records on every call.

I cannot change my domain from Cloudflare to a different service, as my domain initially had its DNS handled by Namecheap (also the registrar I have bought the domain from.) I had to switch from Namecheap to Cloudflare because I need a valid SSL certificate for my domain, and Cloudflare makes that much simpler by just issuing an automatic one when a domain is on their DNS.

Apparently, there was an app in the Truecharts catalog called cloudflare-ddns that served this exact purpose. But obviously, with 20.10 Truecharts is basically gone and I cannot use that Kubernetes-based application anymore.

I’ve also tried using ddns-updater which is on the official TrueNAS app catalog but with no luck. As soon as I finish entering all the parameters and press install, the status shows ‘deploying’ for a couple of seconds and immediately stops. There is no real error message printed to the system console, either.

I enter my ddns-updater parameters like this:

Provider -         Cloudflare
Domain -           nextcloud.mydomain.tld (there is no type A+ DDNS record in my records as Cloudflare does not support that)
Host -             EMPTY
IP Version -       IPv4 and IPv6
Zone ID -          [the zone ID in my domain overview]
TTL -              1
Proxied -          Enabled
Token -            EMPTY (not sure what to put here)
User Service Key - [the account ID in my domain overview]
Email -            [the email of my Cloudflare account]
API Key -          [an API key I generate for my account for the Edit Zone DNS function for my domain. verified working with curl]

Am I doing something wrong? I suspect that I am.

How should I go about setting up DDNS on my Cloudflare domain and making it point to my server? Should I use ddns-updater with a different configuration of parameters? Should I set up some sort of script on my server how Cloudflare wants it? (I’m not sure how to do that)

I am a noob when it comes to TrueNAS and I am now realizing that this project is a bit beyond my depth for a first endeavor. I’m intending to struggle through it, though.

Any help on this is greatly appreciated:) Thanks!

you can run a cloudflare ddns upate in as a custom app using this yaml.

version: '3.5'
services:
  cloudflare-ddns:
    image: oznu/cloudflare-ddns:latest
    restart: always
    environment:
      - API_KEY=
      - ZONE=yourdomain.com
      - ZONE_ID=
      - PROXIED=false
1 Like