libdns / digitalocean

MIT License
10 stars 15 forks source link

Domain can not be found #1

Closed mtricht closed 4 years ago

mtricht commented 4 years ago

The following API call is made to DO: POST https://api.digitalocean.com/v2/domains/example.com./records returning 404 The resource you were accessing could not be found.. There should be no dot at the end of the domain as documented here: https://developers.digitalocean.com/documentation/v2/#update-a-domain-record

scoobybejesus commented 4 years ago

Same issue here.

mholt commented 4 years ago

How can this error be reproduced?

mtricht commented 4 years ago

@mholt Minimal docker image with DO module:

FROM caddy:2-builder AS builder
RUN caddy-builder \
    github.com/caddy-dns/digitalocean

FROM caddy:2-alpine
COPY --from=builder /usr/bin/caddy /usr/bin/caddy

Minimal caddyfile:

*.example.com {
  tls {
    dns digitalocean {token}
  }
}
mholt commented 4 years ago

Oh, you're using Caddy. These libraries are independent of any web server. This should probably be moved to caddy-dns/digitalocean.

mholt commented 4 years ago

Actually we can probably work around the problem here. Caddy uses FQDNs with the DNS provider APIs, but apparently DigitalOcean doesn't support them. I think that's stupid -- if that's the case, they should just ignore any . at the end if present -- but we can do that here too, I guess: strings.TrimSuffix(domain, ".") or something.