How can I add Cloudfare DNS API to work with Cosmos OS?

I have my main domain on Cloudfare, and I want Cosmos OS to manage my DNS so when it created an URL it automatically add the DNS to Cloudfare. I already put my email and DNS EDIT API but no success.

  1. Dynamic vs. Static IP Addresses: Most home internet connections have a dynamic IP address, which means it can change over time. This can be problematic if you want to access your home server from outside because the address you use to reach it today might not work tomorrow.
  2. Using DuckDNS: DuckDNS is a service that provides you with a free domain name and automatically updates this domain with your changing IP address. This way, you can always use the same domain name to access your server, even if your home IP changes.
  3. Setting Up DuckDNS:
  • Sign up for an account at DuckDNS.
  • Choose a subdomain (e.g., yourname.duckdns.org).
  • Install the DuckDNS update script on your home server or use an application that supports DuckDNS which will keep your domain pointed to your current IP address.
  1. CNAME Record:
  • If you have another domain name you prefer to use, you can create a CNAME record in that domain’s DNS settings.
  • The CNAME will point to your DuckDNS domain (e.g., home.yourdomain.com CNAME to yourname.duckdns.org).
  1. Opening Ports on Your Router:
  • Access your router’s settings (this is usually done via a web browser, accessing an IP address like 192.168.1.1).
  • Look for a section called “Port Forwarding” or “Virtual Server”.
  • Open ports 80 (HTTP) and 443 (HTTPS) and point them to the internal IP address of your home server. This step is crucial as it tells your router to send all traffic that comes to these ports to your server.
  1. Security Considerations:
  • Opening ports on your router can make your home network more vulnerable to attacks, so make sure your server is secured properly.

I follow your tutorial and follow the exact same steps, however I keep getting this error: There are errors with your Let’s Encrypt configuration or one of your routes, please fix them as soon as possible:

  • error: one or more domains had a problem: [.myurl.com] [.myurl.com] acme: error presenting token: cloudflare: failed to find zone myurl.com.: ListZonesContext command failed: Invalid request headers (6003) [myurl.com] [myurl.com] acme: error presenting token: cloudflare: failed to find zone myurl.com.: ListZonesContext command failed: Invalid request headers (6003)

And of course I redacted my url , I also check if the API token has the right permissions on Cloudfare and yes everything seems right.

Did you try this in the YouTube description:

UPDATES:

1. In newest version of Cosmos, leave the wildcard override option empty
2. If the CF Token is not working, use the CF API KEY instead in the CF_API_KEY env var

I think something changed.

Sorry for necroposting, but did you consider using a cloudflare ddns updater docker container? Just spin up this container in cosmos cloud.

Make sure to create an api key in cloudflare that has the following permissions: “Zone Settings:Read, Zone:Read, DNS:Edit”. In the docker pompose, I add the api key, I delete the subdomain line becuase I’d rather just cname my subdomains later, and I leave the proxied value to false because some cosmos apps don’t like proxied connections. Hope this helps!

Good suggestion! If you see a post and can help somebody, please do so! It’s all about sharing knowledge here.

The only thing I see on that Github is that it’s archived. It might be better to go with this one: