Updates multiple types of DNS records and origin authentication configurations.
Operation description
This operation allows you to update multiple types of DNS records, including but not limited to A/AAAA, CNAME, NS, MX, TXT, CAA, SRV, and URI. You can modify the record content by providing the necessary fields such as Value, Priority, and Flag. For origins added in CNAME records such as OSS and S3, the API enables you to configure authentication details to ensure secure access.
Usage notes
- The record value (Value) must match the record type. For example, the CNAME record should correspond to the target domain name.
- You must specify a priority (Priority) for some record types, such as MX and SRV.
- You must specify specific fields such as Flag and Tag for CAA records.
- When you update security records such as CERT and SSHFP, you must accurately set fields such as Type and Algorithm.
- If your origin type is OSS or S3, configure the authentication details in AuthConf based on the permissions.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
esa:UpdateRecord | update | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RecordId | long | Yes | The record ID, which can be obtained by calling ListRecords . | 1234567890123 |
Ttl | integer | No | The TTL of the record. Unit: seconds. The range is 30 to 86,400, or 1. If the value is 1, the TTL of the record is determined by the system. | 30 |
Proxied | boolean | No | Specifies whether to proxy the record. Only CNAME and A/AAAA records can be proxied. Valid values:
| true |
Data | object | Yes | The DNS record information. The format of this field varies based on the record type. For more information, see Add DNS records. | |
Value | string | No | The record value or part of the record content. This parameter is required when you add A/AAAA, CNAME, NS, MX, TXT, CAA, SRV, and URI records. It has different meanings based on different types of records:
| example.com |
Priority | integer | No | The priority of the record, specified within the range of 0 to 65,535. A smaller value indicates a higher priority. This parameter is required when you add MX, SRV, and URI records. | 10 |
Flag | integer | No | The flag bit of the record. The Flag for a CAA record indicates its priority and how it is processed, specified within the range of 0 to 255. This parameter is required when you add a CAA record. | 128 |
Tag | string | No | The label of the record. The Tag of a CAA record indicate its specific type and usage. This parameter is required when you add a CAA record. | issue |
Weight | integer | No | The weight of the record, specified within the range of 0 to 65,535. This parameter is required when you add SRV or URI records. | 0 |
Port | integer | No | The port of the record, specified within the range of 0 to 65,535. This parameter is required when you add an SRV record. | 0 |
Type | integer | No | The certificate type of the record (in CERT records), or the public key type (in SSHFP records). This parameter is required when you add CERT or SSHFP records. | 0 |
KeyTag | integer | No | The public key identification for the record, specified within the range of 0 to 65,535. This parameter is required when you add a CAA record. | 0 |
Algorithm | integer | No | The encryption algorithm used for the record, specified within the range from 0 to 255. This parameter is required when you add CERT or SSHFP records. | 0 |
Certificate | string | No | The public key of the certificate. This parameter is required when you add CERT, SMIMEA, or TLSA records. | dGVzdGFkYWxrcw== |
Usage | integer | No | The usage identifier of the record, specified within the range of 0 to 255. This parameter is required when you add SMIMEA or TLSA records. | 0 |
Selector | integer | No | The type of certificate or public key, specified within the range of 0 to 255. This parameter is required when you add SMIMEA or TLSA records. | 0 |
MatchingType | integer | No | The algorithm policy used to match or validate the certificate, specified within the range 0 to 255. This parameter is required when you add SMIMEA or TLSA records. | 0 |
Fingerprint | string | No | The public key fingerprint of the record. This parameter is required when you add a SSHFP record. | abcdef1234567890 |
SourceType | string | No | The type of the origin for the CNAME record. This parameter is required when you add a CNAME record. Valid values:
If you leave the parameter empty or set its value as null, the default is Domain, which is common domain name. | OSS |
BizName | string | No | The business scenario of the record for acceleration. Leave the parameter empty if your record is not proxied. Valid values:
| web |
Comment | string | No | The comments of the record. | This is a remark. |
AuthConf | object | No | The origin authentication information of the CNAME record. | |
AuthType | string | No | The authentication type of the origin server. Different origins support different authentication types. The type of origin refers to the SourceType parameter in this operation. If the type of origin is OSS or S3, you must specify the authentication type of the origin. Valid values:
| private |
SecretKey | string | No | The secret access key of the account to which the origin server belongs. This parameter is required when the SourceType is OSS, and AuthType is private_same_account, or when the SourceType is S3 and AuthType is private. | u0Nkg5gBK*******QF5wvKMM504JUHt |
AccessKey | string | No | The access key of the account to which the origin server belongs. This parameter is required when the SourceType is OSS, and AuthType is private_same_account, or when the SourceType is S3 and AuthType is private. | VIxuvJSA2S03f******kp208dy5w7 |
Region | string | No | The version of the signature algorithm. This parameter is required when the origin type is S3 and AuthType is private. The following two types are supported:
If you leave this parameter empty, the default value v4 is used. | v2 |
Version | string | No | The region of the origin. If the origin type is S3, you must specify this value. You can get the region information from the official website of S3. | us-east-1 |
HostPolicy | string | No | The origin host policy. This policy takes effect when the record type is CNAME. You can set the policy in two modes:
| follow_origin_domain |
The Data field of a record contains the DNS information for the record. The format of this field varies based on the record type. For more information, see Add DNS records.
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "0AEDAF20-4DDF-4165-8750-47FF9C1929C9"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
400 | ServiceInvokeFailed | The call to the internal service failed. The engineer is resolving the problem. Please wait a moment before trying, or contact customer service for details. | Failed to call the service. Please try again later or contact customer service for details. |
400 | InternalException | Failed to call the service. Try again later or contact technical support. | Failed to call the service. Try again later or contact technical support. |
400 | NoPermission | You do not have permissions to access or operate on the resource.Contact your account administrator to attach the AliyunESAFullAccess policy to the current user. | You do not have permissions to access or operate on the resource.Contact your account administrator to attach the AliyunESAFullAccess policy to the current user. |
400 | InvalidParameter.RecordData | Invalid record content. Adjust your configurations based on the API documentation. | Invalid record content. Adjust your configurations based on the API documentation. |
400 | Instance.NotOnline | Your plan is unavailable due to an overdue payment. Complete the payment first. | Your plan is unavailable due to an overdue payment. Complete the payment first. |
400 | Record.Reserved | Another operation on the record is in progress. Try again later. | Another operation on the record is in progress. Try again later. |
400 | Record.ServiceBusy | The record is being configured. Try again later. | The record is being configured. Try again later. |
400 | Record.Conflict | The specified record content conflicts with existing records. Adjust your configurations based on the related product documentation. | The specified record content conflicts with existing records. Adjust your configurations based on the related product documentation. |
400 | SourceCircleExist | The host record of the resource to be operated on is already the source station of another resource, or the source station of the current resource has been added as a host record. To avoid loopback, modify the host record or source station and retry. | The host record of the resource to be operated on is already the source station of another resource, or the source station of the current resource has been added as a host record. To avoid loopback, modify the host record or source station and retry. |
404 | Record.NotFound | The record does not exist. Check your configurations and try again. | The record does not exist. Check your configurations and try again. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-10-10 | The Error code has changed | View Change Details |
2024-09-24 | The Error code has changed | View Change Details |
2024-09-23 | The Error code has changed. The request parameters of the API has changed | View Change Details |