You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To provide your own script to update DNS you need to create (or source) a Windows (CMD) batch file which expects the following sequence of arguments and update a corresponding TXT record in your DNS zone:
7
+
- Target Domain (e.g. `example.com`)
8
+
- Record Name (e.g. `_acme-challenge.example.com`)
9
+
- Record Value (e.g. `ABCBD123456789`)
10
+
- Zone Id (e.g. `OptionalZoneId`, this is often useful to match the specific zone to update)
11
+
12
+
e.g. given a script at *C:\customscripts\UpdateDNS.bat*, this will be executed as:
- Your script will run as the background service user (local system), not as your account.
19
+
- You should assume the working directory of the process will not be the same as the script.
20
+
- When an 'apex domain' like `example.com` is included in the certificate request for a wildcard (e.g. `*.example.com`) both TXT records will have the same name but different values, so updates need to add to the TXT record values. For this reason it's also a good idea to provide a (well tested!) delete script to clean up the TXT record once the request has completed, otherwise your TXT record values will grow with every validation attempt.
21
+
22
+
23
+
## Calling a Python or node script
24
+
To use a Python script (or similarly Node etc) start with a .bat file which can then forward all the arguments as required to your script using `%*` (or you could pass specific arguments if you needed). Note also the fully qualified path to the python exe (or node) as your script will run as local system (using the apps background service) and the path environment variable settings may be different:
25
+
26
+
```bat
27
+
REM This script would be called with the parameters <target domain> <record name> <record value> <zone id (optionally)>
28
+
29
+
REM this example then calls a custom python script forwarding all the arguments
In the following Pythong example the args are available in the `sys.argv` list. This example passes that list to a function called `main` and logs some example stuff (`create_dns_txt_example.py` logging to `dns_create_test.log`).
35
+
36
+
Your real script would use your DNS providers API or a library such as Apache libcloud.
37
+
38
+
```python
39
+
# Example
40
+
41
+
import sys
42
+
import os
43
+
import getopt
44
+
import logging
45
+
46
+
#TODO: added module for DNS updates (libcloud etc)
Copy file name to clipboardExpand all lines: docs/dns-validation.md
+36-17Lines changed: 36 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,41 +4,60 @@ title: About DNS Validation (dns-01)
4
4
---
5
5
6
6
## Why use DNS Validation?
7
-
To request a certificate from Let's Encrypt (or any Certificate Authority), you need to provide some kind of proof that you are entitled to receive the certificate for given domain(s). Let's Encrypt supports two methods of validation to prove control of your domain, `http-01` ([validation over HTTP](http-validation.md)) and `dns-01` (validation via DNS).
7
+
To request a certificate from Let's Encrypt (or any Certificate Authority), you need to provide some kind of proof that you are entitled to receive the certificate for given domain(s). Let's Encrypt supports two methods of validation to prove control of your domain, `http-01` ([validation over HTTP](http-validation.md)) and `dns-01` (validation over DNS).
8
8
9
9
**Wildcard domain certificates (those covering `*.yourdomain.com`) can only be requested using DNS validation.** DNS Validation is also especially useful if the domains you are trying to get certification for are not public websites, or cannot serve http requests on port 80.
10
10
11
11
## How to use DNS Validation
12
12
13
13
In order to validate your control of your domains to the certificate authority you will be required to create a specified TXT record in your domain's DNS zone.
14
14
15
-
To do this you need to get the API credentials for the (hosted) DNS from your DNS providers control panel, store these credentials in the app then select them to be used for specific certificate requests.
15
+
To do this you may need to get the API credentials for the (hosted) DNS from your DNS providers control panel, store these credentials in the app then select them to be used for specific certificate requests.
16
16
17
17
If your DNS provider (or custom DNS setup) does not have an API we can talk to, you can write your own DNS update script or use the Manual DNS option (the request pauses while you manually update DNS).
18
18
19
-
## DNS Providers
19
+
###DNS API Providers
20
20
21
-
The following DNS providers are supported:
22
-
-[Azure DNS](dns-azuredns.md)
21
+
Currently supported DNS API providers include:
22
+
-Aliyun
23
23
-[AWS Route53](dns-awsroute53.md)
24
+
-[Azure DNS](dns-azuredns.md)
24
25
-[Cloudflare](dns-cloudflare.md) DNS *(Note: Cloudflare offer a free tier for DNS services)*
25
26
-[DNS Made Easy](dns-dnsmadeeasy.md)
26
27
-[GoDaddy](dns-godaddy.md)
28
+
- Microsoft DNS
29
+
- NameCheap
27
30
-[OVH](dns-ovh.md)
28
31
- Simple DNS Plus
29
32
30
33
**If you change API credentials, you need to replace the credential settings in Certify under 'Settings > Stored Credentials' to ensure renewals keep working. Once saved, there is also a 'Test' option so you can try out the credentials to check they still work.**
31
34
32
-
## DNS Scripting
33
-
To provide your own script to update DNS you need to create (or source) a Windows (CMD) batch file which expects the following sequence of arguments and update a corresponding TXT record in your DNS zone:
34
-
- Target Domain (e.g. `example.com`)
35
-
- Record Name (e.g. `_acme-challenge.example.com`)
36
-
- Record Value (e.g. `ABCBD123456789`)
37
-
- Zone Id (e.g. `OptionalZoneId`, this is often useful to match the specific zone to update)
38
-
39
-
e.g. given a script at *C:\customscripts\UpdateDNS.bat*, this will be executed as:
Notes: you should assume the working directory of the process will not be the same as the script. When an 'apex domain' like `example.com` is included in the certificate request for a wildcard (e.g. `*.example.com`) both TXT records will have the same name but different values, so updates need to add to the TXT record values. For this reason it's also a good idea to provide a (well tested!) delete script to clean up the TXT record once the request has completed, otherwise your TXT record values will grow with every validation attempt.
35
+
## Other DNS Validation Methods
36
+
You can alternatively use the following methods to manage your DNS TXT records:
37
+
38
+
### ACME DNS
39
+
[acme-dns](https://github.com/joohoi/acme-dns) is a system to automatically manage TXT record values on behalf of your domain **just for challenge validation**. This is probably the easiest method if you have a trusted acme-dns server you can use, this also avoids storing powerful DNS admin credentials on your server.
40
+
41
+
- Select acme-dns as the DNS update method
42
+
- Point to a trusted acme-dns server
43
+
- Request certificate, the first time you do so you will be prompted to create a CNAME pointing to the acme-dns server.
44
+
- Resume the request using Request Certificate, the acme-dns server will provide the required TXT record responses on your behalf.
45
+
- Automatic renewals will then perform this process again without manual intervention.
46
+
47
+
### DNS Scripting
48
+
[DNS Scripting](dns-scripting.md) involves providing your own custom script to update/delete TXT records in your DNS using a .bat file which can then optionally call python, node scripts etc.
49
+
50
+
### Manual DNS
51
+
If you are just experimenting with wildcard domains you may opt to use manual DNS updates (editing manually via your DNS control panel).
52
+
53
+
**This is the least recommended option as you will need to update this for every renewal.**
54
+
55
+
This method can also be extremely confusing when requesting a single cert for `*.domain.com` and `domain.com`, as you need to provide 2 values for the same TXT `_acme-challenge.domain.com` record (to answer both the `*.domain.com` and `domain.com` challenge responses).
56
+
57
+
To use Manual DNS:
58
+
- Select Manual DNS as your DNS update method
59
+
- Perform your initial certificate request. The request will pause and ask you to create a TXT record in your domain (one value for each domain or wildcard). Once you have completed that, wait for your DNS name servers to complete propagation. If you have trouble validating, wait an hour or more for this to complete.
60
+
- Use 'Request Certificate' to resume the request and check validation.
61
+
- If the certificate authority can see the TXT value they asked for in your DNS, they will then allow a certificate to be issued and the request will resume as normal.
0 commit comments