A native Caddy DNS provider module for Baidu Cloud DNS (百度智能云解析), built directly on the libdns interfaces used by certmagic — no lego dependency.
It lets Caddy solve ACME DNS-01 challenges for domains whose DNS is hosted at Baidu Cloud.
xcaddy build v2.11.4 \
--with github.com/taichi-dev/caddy-baidudns*.example.com {
tls {
dns baiducloud
}
...
}
The directive takes no arguments. Credentials are read from the environment:
BAIDUCLOUD_ACCESS_KEY_ID=your-access-key-id
BAIDUCLOUD_SECRET_ACCESS_KEY=your-secret-access-key
If Caddy runs as a systemd service, load them via EnvironmentFile= or an Environment= line in the unit.
- Record TTLs below 300s are raised to 300s (Baidu Cloud's minimum for free accounts).
- Baidu Cloud's API does not return a record ID on create, so deletions are done by listing and matching name/type.
- Zones are resolved automatically by certmagic (SOA lookup); only the zone name needs to be reachable as an authoritative zone in your Baidu account.
- Module ID:
dns.providers.baiducloud - Interfaces:
certmagic.DNSProvider,libdns.RecordGetter/Appender/Setter/Deleter
The repository also ships dnsctl, a small CLI for managing Baidu Cloud DNS records directly —
useful for one-off changes, inspecting what ACME wrote, and cleaning up stale challenge records:
go install github.com/taichi-dev/caddy-baidudns/cmd/dnsctl@latestSee cmd/dnsctl/README.md for usage and caveats.