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.


  1. Follow the general steps described in the How to add records guide.
  2. 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>.
  3. In the Type dropdown menu, select TXT.
  4. In Value, input the value for the ACME challenge provided by the Let’s Encrypt provider. Example: ekgH9kW242Vbt99P27agtr07I09iLsiZZx.
  5. In TTL (seconds), choose the time, in seconds, a response can be cached for on a resolver server. Maximum value: 2147483647.
  6. Click the Save button.

  1. Run the following GET request in your terminal, replacing [TOKEN VALUE] with your personal token to retrieve your <hosted_zone_id>:
Terminal window
curl --location 'https://api.azionapi.net/intelligent_dns' \
--header 'Authorization: Token [TOKEN VALUE]' \
--header 'Accept: application/json; version=3'
  1. You’ll receive a response with all your existing zones. Copy the value of the <id> that you want to use.
  2. Run the following POST request, replacing [TOKEN VALUE] with your personal token and the <hosted_zone_id> value you copied:
Terminal window
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
}'
  1. 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.