天天看點

搭建自己的 acme-dns server

acme-dns要實作的功能一個是可以調用其提供的register/update等endpoint,另一個是能夠接受所有的x.auth.acme-dns.io格式的域名通路。

域名配置

auth.acme-dns.io
*.auth.acme-dns.io ns auth.acme-dns.io        

NS record for auth.example.org pointing to auth.example.org (this means, that auth.example.org is responsible for any *.auth.example.org records)

A record for auth.example.org pointing to 198.51.100.1

注意:阿裡雲機器的防火牆

增加80 53/tcp 53/udp 的進出配置

提前建立config.cfg檔案,放在将要挂載到容器内的/etc/acme-dns目錄的檔案夾

​​configuration template to​​

Docker 安裝

docker run --rm --name acmedns                 \
 -p 53:53                                      \
 -p 53:53/udp                                  \
 -p 80:80                                      \
 -v /root/acme-dns/config:/etc/acme-dns:ro      \
 -v /root/acme-dns/data:/var/lib/acme-dns       \
 -d joohoi/acme-dns      

測試

第一步驟

curl -X POST http://auth.taomiao.store/register      

第二部使用acme.sh 用戶端測試

export ACMEDNS_UPDATE_URL="http://auth.taomiao.store/update"
export ACMEDNS_USERNAME="86aeea0f-def3-4336-a6ed-e5c550d8e759"
export ACMEDNS_PASSWORD="pbliwppj0AmRY5ihpbpmxWAaqnXnfgKQkovZSqyv"
export ACMEDNS_SUBDOMAIN="50231d33-06bb-4ae0-9e31-dad3c1d705a8"      
acme.sh --issue --dns dns_acmedns -d test2.greenwhale.tech      
dig txt _acme-challenge.test2.greenwhale.tech      

acme-dns 存儲