You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

189 lines
4.5 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. # How to use dns api
  2. ## Use CloudFlare domain api to automatically issue cert
  3. For now, we support clourflare integeration.
  4. First you need to login to your clourflare account to get your api key.
  5. ```
  6. export CF_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
  7. export CF_Email="xxxx@sss.com"
  8. ```
  9. Ok, let's issue cert now:
  10. ```
  11. acme.sh --issue --dns dns_cf -d example.com -d www.example.com
  12. ```
  13. The `CF_Key` and `CF_Email` will be saved in `~/.acme.sh/account.conf`, when next time you use cloudflare api, it will reuse this key.
  14. ## Use Dnspod.cn domain api to automatically issue cert
  15. For now, we support dnspod.cn integeration.
  16. First you need to login to your dnspod.cn account to get your api key and key id.
  17. ```
  18. export DP_Id="1234"
  19. export DP_Key="sADDsdasdgdsf"
  20. ```
  21. Ok, let's issue cert now:
  22. ```
  23. acme.sh --issue --dns dns_dp -d example.com -d www.example.com
  24. ```
  25. The `DP_Id` and `DP_Key` will be saved in `~/.acme.sh/account.conf`, when next time you use dnspod.cn api, it will reuse this key.
  26. ## Use Cloudxns.com domain api to automatically issue cert
  27. For now, we support Cloudxns.com integeration.
  28. First you need to login to your Cloudxns.com account to get your api key and key secret.
  29. ```
  30. export CX_Key="1234"
  31. export CX_Secret="sADDsdasdgdsf"
  32. ```
  33. Ok, let's issue cert now:
  34. ```
  35. acme.sh --issue --dns dns_cx -d example.com -d www.example.com
  36. ```
  37. The `CX_Key` and `CX_Secret` will be saved in `~/.acme.sh/account.conf`, when next time you use Cloudxns.com api, it will reuse this key.
  38. ## Use Godaddy.com domain api to automatically issue cert
  39. We support Godaddy integration.
  40. First you need to login to your Godaddy account to get your api key and api secret.
  41. https://developer.godaddy.com/keys/
  42. Please Create a Production key, instead of a Test key.
  43. ```
  44. export GD_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
  45. export GD_Secret="asdfsdafdsfdsfdsfdsfdsafd"
  46. ```
  47. Ok, let's issue cert now:
  48. ```
  49. acme.sh --issue --dns dns_gd -d example.com -d www.example.com
  50. ```
  51. The `GD_Key` and `GD_Secret` will be saved in `~/.acme.sh/account.conf`, when next time you use cloudflare api, it will reuse this key.
  52. ## Use PowerDNS embedded api to automatically issue cert
  53. We support PowerDNS embedded API integration.
  54. First you need to enable api and set your api-token in PowerDNS configuration.
  55. https://doc.powerdns.com/md/httpapi/README/
  56. ```
  57. export PDNS_Url="http://ns.example.com:8081"
  58. export PDNS_ServerId="localhost"
  59. export PDNS_Token="0123456789ABCDEF"
  60. export PDNS_Ttl=60
  61. ```
  62. Ok, let's issue cert now:
  63. ```
  64. acme.sh --issue --dns dns_pdns -d example.com -d www.example.com
  65. ```
  66. The `PDNS_Url`, `PDNS_ServerId`, `PDNS_Token` and `PDNS_Ttl` will be saved in `~/.acme.sh/account.conf`.
  67. ## Use OVH/kimsufi/soyoustart/runabove API
  68. https://github.com/Neilpang/acme.sh/wiki/How-to-use-OVH-domain-api
  69. ## Use nsupdate to automatically issue cert
  70. First, generate a key for updating the zone
  71. ```
  72. b=$(dnssec-keygen -a hmac-sha512 -b 512 -n USER -K /tmp foo)
  73. cat > /etc/named/keys/update.key <<EOF
  74. key "update" {
  75. algorithm hmac-sha512;
  76. secret "$(awk '/^Key/{print $2}' /tmp/$b.private)";
  77. };
  78. EOF
  79. rm -f /tmp/$b.{private,key}
  80. ```
  81. Include this key in your named configuration
  82. ```
  83. include "/etc/named/keys/update.key";
  84. ```
  85. Next, configure your zone to allow dynamic updates.
  86. Depending on your named version, use either
  87. ```
  88. zone "example.com" {
  89. type master;
  90. allow-update { key "update"; };
  91. };
  92. ```
  93. or
  94. ```
  95. zone "example.com" {
  96. type master;
  97. update-policy {
  98. grant update subdomain example.com.;
  99. };
  100. }
  101. ```
  102. Finally, make the dns server and update key available to `acme.sh`
  103. ```
  104. export NSUPDATE_SERVER=dns.example.com
  105. export NSUPDATE_KEY=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa==
  106. ```
  107. Ok, let's issue cert now:
  108. ```
  109. acme.sh --issue --dns dns_nsupdate -d example.com -d www.example.com
  110. ```
  111. The `NSUPDATE_SERVER` and `NSUPDATE_KEY` settings will be saved in `~/.acme.sh/account.conf`.
  112. # Use custom api
  113. If your api is not supported yet, you can write your own dns api.
  114. Let's assume you want to name it 'myapi',
  115. 1. Create a bash script named `~/.acme.sh/dns_myapi.sh`,
  116. 2. In the script, you must have a function named `dns_myapi_add()`. Which will be called by acme.sh to add dns records.
  117. 3. Then you can use your api to issue cert like:
  118. ```
  119. acme.sh --issue --dns dns_myapi -d example.com -d www.example.com
  120. ```
  121. For more details, please check our sample script: [dns_myapi.sh](dns_myapi.sh)
  122. # Use lexicon dns api
  123. https://github.com/Neilpang/acme.sh/wiki/How-to-use-lexicon-dns-api