Skip to content

Let's Encrypt DNS 01 Challenge

手动

Bash
sudo certbot certonly --manual --preferred-challenges dns -d xxx.blackshop.icu
# certbot 会提示你在 DNS 里加一条 TXT 记录,然后你手动去 DNS 管理控制台添加。添加完按回车继续。

自动

Bash
# 安装支持 DNS 的 certbot 插件
sudo apt install python3-certbot-dns-cloudflare

# 文件token
echo 'dns_cloudflare_api_token = xyz' > /path/to/cloudflare.ini
chmod 600 /path/to/cloudflare/cf.ini

# 续期
sudo certbot certonly \
  --dns-cloudflare \
  --dns-cloudflare-credentials /path/to/cloudflare.ini \
  -d xxx.blackshop.icu

ref