Caddy DNS DigitalOcean - Incorrect TXT Record

1. Caddy version (caddy version):

v2.2.0

2. How I run Caddy:


#### a. System environment:
<!-- OS, relevant versions, systemd? Docker? etc. -->
**OS: Ubuntu 18.04.5 LTS**
**systemd: 237**


#### b. Command:

service caddy start


#### c. Service/unit/compose file:

[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target

[Service]
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile
TimeoutStopSec=5s
LimitNOFILE=1048576
LimitNPROC=512
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target


#### d. My complete Caddyfile or JSON config:

sketchperez.com, studiosketch.co, *.studiosketch.co {
root * /var/www/studiosketch.co/public
php_fastcgi 127.0.0.1:9000

encode gzip
file_server
tls {
    dns digitalocean [redacted]
}

}


### 3. The problem I'm having:

I added the caddy-dns module for digital ocean so I can get wildcard SSL working. I was running into an error with the dns validation succeeding. After looking again I noticed that the TXT record was incorrect in my digitalocean dns manager. The dns module had added the domain name for the cert twice. And this was causing the challenge to not succeed. I manually copied the _acme-challenge and updated the host section to correct this and was able to obtain the SSL successfully. This seems to be due to digitalocean only wanting the host part without the domain via the API, since they add the domain part.

**DNS Record that was added by the plugin:**

Record Type: TXT
Host: _acme-challenge.sketchperez.com.sketchperez.com
Value: [Redacted]
TTL: 1800

### 4. Error messages and/or full log output:

“msg”:“trying to solve challenge”




### 5. What I already tried:
I manually added the correct record to verify this was the issue and then the challenged was solved correctly. I tried looking through the github repo to see if I could contribute some code changes to resolve the issue but couldn't find where the API call is being made. 



### 6. Links to relevant resources:
https://github.com/caddy-dns/digitalocean

You’re probably encountering this issue, there’s a problem with the DO DNS plugin:

https://github.com/libdns/digitalocean/pull/3

1 Like

Yup looks like the same issue for sure. Thank you for the link

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