I'm doing a multi-domain DNS challenge via --dns-cloudflare on certbot 1.21.0 and I've encountered this issue multiple times where it seems that the TXT records are being mixed up. The error I'm getting is:
Certbot failed to authenticate some domains (authenticator: dns-cloudflare). The Certificate Authority reported these problems:
(...)
Detail: Incorrect TXT record "1cbWW33xpKwwkV6WlnEI3pKTzM7IqRia7R01jnEQJ2A" found at (...)
Note that the TXT record itself changes every time I run it (so the creation of the record does work), but I think it's getting the records mixed up. The command I'm running is:
So I'm guessing that rather than putting both the challenges (or one of them at a time in the correct order, I don't know), it only puts one and it's the one for the wrong -d entry.
This has worked in the past, and the last time I switched the domains around which resolved the issue, but now it's started happening again. Does anyone know what the issue is? Is it the cloudflare plugin messing things up, or have I missed something?
Thanks for the heads up, I'm using the certbot package from the Ubuntu 22 repos so I'll see if I can manage to get a hold of a newer one.
There are currently five TXT records, none of them are related to acme renewals, it's just DMARC, SPF and stuff like that.
This is using Cloudflare's DNS servers so SOA is [something].ns.cloudflare.com and dns.cloudflare.com, I have no idea how many actual "servers" that corresponds to in reality.
I removed the "certbot" apt package as well as the "python3-cloudflare" package followed by:
snap install certbot
snap set certbot trust-plugin-with-root=ok
snap install certbot-dns-cloudflare
When I ran the same certbot certonly command as in the initial post I initially got the same error, but then I remembered I also had to remove the "python3-cloudflare" package, and then it worked.
It's a bit unfortunate that snap is enforced to run certbot (even on Debian), it would be nice to be able to just run it in a python venv or something, but anyway it works so thanks for the pointers.
Certbot docs for installing with Pip in a venv are here.
The certbot team recommends snap because it’s isolated and updates automatically, which is a good option for many people, but it isn’t the only option.