Proper way to use Cloudflare DNS for getting HTTPS cert

1. Caddy version (caddy version):


2. How I run Caddy:


a. System environment:

Built using xcaddy on ubuntu 20.04 using the .deb provided systemd unit

b. Command:

systemctl restart caddy

c. Service/unit/compose file:

Stock one on ubuntu

d. My complete Caddyfile or JSON config:

3. The problem I’m having:

Caddy returns unrecognized directive: DNS
caddy list-modules does however show dns.providers.cloudflare as available

4. Error messages and/or full log output:

run: adapting config using caddyfile: /etc/caddy/Caddyfile:15: unrecognized directive: dns

5. What I already tried:

What’s in the caddyfile.

6. Links to relevant resources:

tls config is per-site, not global. The Caddyfile is parsing tls as being a site name there.

You can make use of snippets to avoid repetition (also, read the rest of this page in the docs to get a better understanding of the Caddyfile structure):

Ah, see I went through that but it doesn’t mention the tls directive specifically, and that was the only issue I had with the caddyfile


This topic was automatically closed after 30 days. New replies are no longer allowed.