How to add a TXT record to configure Let's Encrypt certificate
While creating the Let’s Encrypt certificate over DNS challenge method, you have to add a specific TXT record to your DNS zone to ensure the certificate validation. If your zone is hosted in Edge DNS, follow the steps described next.
- Follow the general steps described in the How to add records guide.
- In Name, provide the new record’s name required by the Let’s Encrypt certification request, such as the Certbot tool, in a string format. Limited to 100 characters. Example:
_acme-challenge.<YOUR_DOMAIN>
. - In the Record Type dropdown menu, select TXT.
- In Value, input the value for the ACME challenge provided by the Let’s Encrypt provider. Example:
ekgH9kW242Vbt99P27agtr07I09iLsiZZx
. - In TTL (seconds), choose the time, in seconds, a response can be cached for on a resolver server. Maximum value:
2147483647
. - Click the Save button.
- Run the following
GET
request in your terminal, replacing[TOKEN VALUE]
with your personal token to retrieve your<hosted_zone_id>
:
curl --location 'https://api.azionapi.net/intelligent_dns' \--header 'Authorization: Token [TOKEN VALUE]' \--header 'Accept: application/json; version=3'
- You’ll receive a response with all your existing zones. Copy the value of the
<id>
that you want to use. - Run the following
POST
request, replacing[TOKEN VALUE]
with your personal token and the<hosted_zone_id>
value you copied:
curl --location 'https://api.azionapi.net/intelligent_dns/<hosted_zone_id>/records' \--header 'Content-Type: application/json' \--header 'Authorization: Token [TOKEN VALUE]' \--header 'Accept: application/json; version=3' \--data-raw '{ "record_type": "TXT", "entry": "_acme-challenge.<YOUR_DOMAIN>", "answers_list": [ "ekgH9kW242Vbt99P27agtr07I09iLsiZZx" ], "ttl": 20}'
- You’ll receive a response similar to this:
{ "results": { "answers_list": [ "ekgH9kW242Vbt99P27agtr07I09iLsiZZx" ], "zone_id": 1234, "record_type": "TXT", "ttl": 20, "policy": "simple", "entry": "_acme-challenge.<YOUR_DOMAIN>", "id": 56506, "description": "" }, "schema_version": 3}
Wait a few minutes for the changes to propagate and your records will be created in the hosted zone you chose.
Contributors