6.6 KiB
DigitalOcean DNS Provider Setup
Overview
DigitalOcean provides DNS hosting for free with any DigitalOcean account. This guide covers setting up DigitalOcean DNS as a provider in Charon for wildcard certificate management.
Prerequisites
- DigitalOcean account (free tier is sufficient)
- Domain added to DigitalOcean DNS
- Domain nameservers pointing to DigitalOcean:
ns1.digitalocean.comns2.digitalocean.comns3.digitalocean.com
Step 1: Generate Personal Access Token
- Log in to DigitalOcean Control Panel
- Click on API in the left sidebar (under Account)
- Navigate to the Tokens/Keys tab
- Click Generate New Token (in the Personal access tokens section)
- Configure the token:
- Token Name:
charon-dns-challenge(or any descriptive name) - Expiration: Choose expiration period (90 days, 1 year, or no expiry)
- Scopes: Select Write (this includes Read access)
- Token Name:
- Click Generate Token
- Copy the token immediately (shown only once)
Warning: DigitalOcean shows the token only once. Store it securely in a password manager.
Step 2: Verify DNS Configuration
Ensure your domain is properly configured in DigitalOcean DNS:
- Navigate to Networking → Domains in the DigitalOcean control panel
- Verify your domain is listed
- Click on the domain to view DNS records
- Ensure at least one A or CNAME record exists (for the domain itself)
Note: Charon will create and remove TXT records automatically; no manual DNS configuration is needed.
Step 3: Configure in Charon
- Navigate to DNS Providers in Charon
- Click Add Provider
- Fill in the form:
- Provider Type: Select
DigitalOcean - Name: Enter a descriptive name (e.g., "DigitalOcean DNS")
- API Token: Paste the Personal Access Token from Step 1
- Provider Type: Select
Advanced Settings (Optional)
Expand Advanced Settings to customize:
- Propagation Timeout:
90seconds (DigitalOcean propagates quickly) - Polling Interval:
10seconds (default) - Set as Default: Enable if this is your primary DNS provider
Step 4: Test Connection
- Click Test Connection button
- Wait for validation (usually 3-5 seconds)
- Verify you see: ✅ Connection successful
The test verifies:
- Token is valid and active
- Account has DNS write permissions
- DigitalOcean API is accessible
If the test fails, see Troubleshooting below.
Step 5: Save Configuration
Click Save to store the DNS provider configuration. The token is encrypted at rest using AES-256-GCM.
Step 6: Use with Wildcard Certificates
When creating a proxy host with a wildcard domain:
- Navigate to Proxy Hosts → Add Proxy Host
- Enter a wildcard domain:
*.example.com - Select DigitalOcean from the DNS Provider dropdown
- Configure remaining settings
- Save
Charon will automatically obtain a wildcard certificate using DNS-01 challenge.
Example Configuration
Provider Type: digitalocean
Name: DigitalOcean - example.com
API Token: dop_v1_********************************
Propagation Timeout: 90 seconds
Polling Interval: 10 seconds
Default: Yes
Required Permissions
The Personal Access Token needs Write scope, which includes:
- Read access to domains and DNS records
- Write access to create/update/delete DNS records
Note: Token scope is account-wide. You cannot restrict to specific domains in DigitalOcean.
Troubleshooting
Connection Test Fails
Error: Invalid token or Unauthorized
- Verify the token was copied correctly (should start with
dop_v1_) - Ensure token has Write scope (not just Read)
- Check token hasn't expired (if expiration was set)
- Regenerate the token if necessary
Error: Domain not found
- Verify the domain is added to DigitalOcean DNS
- Ensure domain nameservers point to DigitalOcean
- Check domain status in the Networking section
- Wait 24-48 hours if nameservers were recently changed
Certificate Issuance Fails
Error: DNS propagation timeout
-
DigitalOcean DNS typically propagates in <60 seconds
-
Verify nameservers are correctly configured:
dig NS example.com +short -
Check DigitalOcean Status page for service issues
-
Increase Propagation Timeout to 120 seconds as a workaround
Error: Record creation failed
- Check token permissions (must be Write scope)
- Verify domain exists in DigitalOcean DNS
- Review Charon logs for detailed API errors
- Ensure no conflicting TXT records exist with name
_acme-challenge
Nameserver Propagation
Issue: DNS changes not visible globally
- Nameserver changes can take 24-48 hours to propagate
- Use DNS Checker to verify global propagation
- Ensure your domain registrar shows DigitalOcean nameservers
- Wait for full propagation before attempting certificate issuance
Rate Limiting
DigitalOcean API rate limits:
- 5,000 requests per hour (per account)
- Certificate challenges typically use <20 requests
If you hit limits:
- Reduce frequency of certificate renewals
- Avoid unnecessary test connection attempts
- Contact DigitalOcean support if consistently hitting limits
Security Recommendations
- Token Expiration: Set 90-day expiration and rotate regularly
- Dedicated Token: Create a separate token for Charon (easier to revoke)
- Monitor Usage: Review API logs in DigitalOcean control panel
- Least Privilege: Use Write scope (don't grant Full Access)
- Backup Access: Keep a backup token in secure storage (offline)
- Revoke Unused: Delete tokens that are no longer needed
DigitalOcean DNS Limitations
- No per-domain token scoping: Tokens grant access to all domains in the account
- No rate limit customization: Fixed at 5,000 requests/hour
- Public zones only: Private DNS not supported
- No DNSSEC: DigitalOcean does not support DNSSEC at this time
Additional Resources
- DigitalOcean DNS Documentation
- DigitalOcean API Documentation
- Personal Access Tokens Guide
- Caddy DigitalOcean Module
- DigitalOcean Status Page