[BUG] Unable to get SSL certificate with dns-01 challenge for domains with a CNAME record
Describe the bug Creating a wildcard certificate for domains wich have a wilcard CNAME record is not possible, because dns-01 challenge tries to change DNS entries for CNAME domain.
To Reproduce
DNS Settings *.home.mydomain.com > CNAME > myhome.dyndns.xyz
Use ACME tool to create a certificate for *.home.mydomain.com or test.home.mydomain.com
Should create following: _acme_challenge.home.mydomain.com Instead tries to create: _acme_challenge.myhome.dyndns.xyz
Error Log:
[2025-02-26 20:55:11.548560] [ACME] [system:info] Obtaining certificate for: test.home.mydomain.com
[2025-02-26 20:55:11.548578] [ACME] [system:info] Using https://acme-v02.api.letsencrypt.org/directory for CA Directory URL
2025/02/26 20:55:12 [INFO] acme: Registering account for [email protected]
2025/02/26 20:55:12 [INFO] [test.home.mydomain.com] acme: Obtaining bundled SAN certificate
2025/02/26 20:55:12 [INFO] [test.home.mydomain.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/2251786505/481918168585
2025/02/26 20:55:12 [INFO] [test.home.mydomain.com] acme: Could not find solver for: tls-alpn-01
2025/02/26 20:55:12 [INFO] [test.home.mydomain.com] acme: Could not find solver for: http-01
2025/02/26 20:55:12 [INFO] [test.home.mydomain.com] acme: use dns-01 solver
2025/02/26 20:55:12 [INFO] [test.home.mydomain.com] acme: Preparing to solve DNS-01
2025/02/26 20:55:12 [INFO] Found CNAME entry for "_acme-challenge.test.home.mydomain.com.": "myhome.dyndns.xyz."
2025/02/26 20:55:14 [INFO] no existing records, error ignored: error when sending the request: an error occurred during the action infoDnsRecords: [Status=error, StatusCode=5029, ShortMessage=Getting DNS records failed, LongMessage=Can not get DNS records for zone. Domain not found.]
2025/02/26 20:55:14 [INFO] [test.home.mydomain.com] acme: Cleaning DNS-01 challeng
Error Log DNS API (netcup provider):
Can not update (all) DNS records for zone. Domain (myhome.dyndns.xyz) not found.
Expected behavior
Functionality to be added to remove CNAME support from lego. (With additional environment variable?) See: https://go-acme.github.io/lego/usage/cli/options/#lego_disable_cname_support and https://github.com/go-acme/lego/blob/55b012ba067b565580cf12a7d995ebfc0cbb7a52/challenge/dns01/dns_challenge.go#L201
Host Environment (please complete following information, DO NOT REMOVE ANY FIELD(S)):
- Arch: x64
- Device: Proxmox LCX
- OS: Ubuntu 24.04
- Are you using Docker? yes
- Docker Version: 3.1.8
Supplementary links https://community.traefik.io/t/purpose-of-lego-disable-cname-support/18829