After defining your Edge DNS main settings, you can add records to specify which IPs are associated with the domain and how Edge DNS should handle requests for the domain.
- Access Azion Console > Edge DNS.
- From the list, choose the Edge DNS zone in which you want to add records.
- Select the Records tab.
- Click the + Record button.
- In Name, provide the new record’s name.
- Depending on the type of record you want to use, there may exist specific formats and recommendations.
- In Record Type, select the type of record you want to add.
- Accepts the types
A,AAAA,ANAME,CAA,CNAME,DS,MX,NS,PTR,SRV, andTXT.
- In Value, add the items for the DNS response to the registered record. The accepted values vary according to the chosen type of record.
- In TTL (seconds), choose the time, in seconds, that a response can be cached on a resolver server. Maximum value:
2147483647. - In Policy, select between Simple or Weighted.
- If you select Weighted in Policy:
- In Weight, specify the weight for each record. Accepts values from
0to255. - In Description (optional), you can describe, for example, the distinction between records with the same Name and Type. Accepts up to 45 characters.
- Click the Save button.
- Run the following
GETrequest in your terminal, replacing[TOKEN VALUE]with your personal token to retrieve your<zone_id>:
curl --request GET --url https://api.azion.com/v4/edge_dns/zones --header 'Accept: application/json' --header 'Authorization: Token [TOKEN VALUE]]'- You’ll receive a response with all your existing firewalls. Copy the value of the
<id>that you want to use. - Run the following
POSTrequest, replacing[TOKEN VALUE]with your personal token and the<zone_id>value you copied:
curl --request POST --url https://api.azion.com/v4/dns/zones/<zone_id>/records --header 'Accept: application/json' --header 'Authorization: Token [TOKEN VALUE]' --header 'Content-Type: application/json' --data '{ "type": "CNAME", "name": "www", "rdata": ["www.mydomain.com"], "ttl": 20, "description": "description"}'Wait a few minutes for the changes to propagate and your records will be created in the hosted zone you chose.