TimothyYe / godns

A dynamic DNS client tool that supports AliDNS, Cloudflare, Google Domains, DNSPod, HE.net & DuckDNS & DreamHost, etc, written in Go.
https://timothyye.github.io/godns/
Apache License 2.0
1.5k stars 220 forks source link

[feature] Create subdomains on Cloudflare #167

Closed WesleyBatista closed 2 years ago

WesleyBatista commented 2 years ago

For Linode provider we seem to support auto creation of subdomain if it does not exist (mentioned in the docs and implemented here), however for Cloudflare I currently get:

level=error msg=NXDOMAIN

Error goes away once I manually create the A record from Cloudflare > DNS UI, but I would like to manage everything as code. Would be cool having the same behavior as for Linode for Cloudflare as well.

It would also be nice to have the non-existent subdomain in the error message so it saves one round of checking back in the code/configs which subdomain failed.

As side note, thanks for this amazing tool :heart:

TimothyYe commented 2 years ago

Thanks for the suggestion, the providers are implemented by different contributors, so the behaviors may be different from each other.

I'll look into the API docs of Cloudflare and try to create the subdomains instead of throwing out the errors.

WesleyBatista commented 2 years ago

Thanks a lot for implementing so fast! Works from my side :sparkles:

However, it creates the record with proxying disabled (I see it's the default when calling the API), thus the IP gets exposed, and I am still required going to the Cloudflare UI to enable record by record. It would be awesome if we had the option to instruct "proxied":true