Adding new DNS zone hosted by Cloudflare fails

SYSTEM INFORMATION
OS type and version Debian Linux 12
Webmin version 2.302
Virtualmin version 7.30.7 Pro
Webserver version nginx/1.22.1
Related packages SUGGESTED

I recently installed Cloudflare as my Cloud DNS Provider and successfully moved all locally hosted records there, but once I try to create a new Virtual Server Virtualmin fails to create any DNS Records (either in Cloudflare either Locally Hosted) with the following error:

Adding new DNS zone hosted by Cloudflare DNS … … failed to generate records :

Or if it’s locally hosted:
Adding new DNS zone …
… failed to generate records :

Hello,

Does the zone you’re trying to add already exist in Cloudflare?

No, it doesn’t and it doesn’t make a difference if I create it manually. Also this happens on local DNS records as well.

That’s odd.

Can you add error_stack=1 to the /etc/webmin/config file and try again?

Also, is there anything related logged in the /var/webmin/miniserv.error file?

I added error_stack=1 and the behavior is the same.

Also nothing new shows up on /var/webmin/miniserv.error file when trying to enable DNS for a domain again:

Can you provide more details about this process? Are you trying to add a top-level virtual server or a sub-server virtual server?

Could you also provide a screenshot of the “System Settings ⇾ Server Templates / DNS for domain” page? I’d like to see what you have set for the “Create new DNS zones on” option in particular.

I’m asking because I tried to reproduce this issue, and it worked just fine for me.

I am trying to create a new top-level virtual server. You can see the settings below, this started after installing Cloudflare as a cloud Provider for DNS, I managed to transfer all the pre-existing servers but I cannot create new ones.

Could you try setting the “Create new DNS zones on” option to use Cloudflare and see if that resolves your original issue?

There could be a specific topic in the docs for using Cloudflare with Webmin/Virtualmin.
I have already tried to use it on a VPS and the main information I get is that there are a lot of redirects.

We have it right here:

1 Like

The DNS zones at the registrar are correct, propagation is also ok.
I also changed the Server Templates after seeing that it didn’t work.

Could you elaborate on what you mean by “DNS zones at the registrar are correct”?

Configuring DNS for existing domains

Cloudflare API key here the names confuse:

  • Cloudflare API key, Cloud DNS Provider - Authentication type ;
  • API token > this is unique
    On the page where the link directs API Token - Keys used to access Cloudflare APIs, there are:
  • Global API Key;
  • Origin CA Key

Cloudflare API key = API token?

Hello,

Can we return to the original problem of the ticket? I tried re-enabling the host on cloudflare with no success :confused:

Try changing “Create new DNS zones on” option to “Cloudflare” on the “System Settings ⇾ Server Templates: DNS for domain” page and give it another shot.

That’s what I did but nothing changed.

Change the SSL setting in Cloudflare from Flexible to Full (strict) and the issue should be resolved.

This doesn’t happen in one domain only. It happens on all domains. Also as I said, since enabling cloudflare, local DNS doesn’t work either.