diff --git a/providers/dns/acmedns/acmedns.go b/providers/dns/acmedns/acmedns.go index 8dedeb1284..15e0a1da7b 100644 --- a/providers/dns/acmedns/acmedns.go +++ b/providers/dns/acmedns/acmedns.go @@ -172,14 +172,16 @@ func (d *DNSProvider) Present(domain, _, keyAuth string) error { // Check if credentials were previously saved for this domain. account, err := d.storage.Fetch(ctx, domain) if err != nil { - if errors.Is(err, storage.ErrDomainNotFound) { - // The account did not exist. - // Create a new one and return an error indicating the required one-time manual CNAME setup. - return d.register(ctx, domain, info.FQDN) + if !errors.Is(err, storage.ErrDomainNotFound) { + return err } - // Errors other than goacmedns.ErrDomainNotFound are unexpected. - return err + // The account did not exist. + // Create a new one and return an error indicating the required one-time manual CNAME setup. + err = d.register(ctx, domain, info.FQDN) + if err != nil { + return err + } } // Update the acme-dns TXT record.