How to use authenticate with a DNS record?

A post was split to a new topic: Certbot with standalone fails with “could not connect”