All Products
Search
Document Center

Edge Security Acceleration:UpdateRecord

Last Updated:Apr 16, 2025

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
esa:UpdateRecordupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RecordIdlongYes

The record ID, which can be obtained by calling ListRecords .

1234567890123
TtlintegerNo

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
ProxiedbooleanNo

Specifies whether to proxy the record. Only CNAME and A/AAAA records can be proxied. Valid values:

  • true
  • false
true
DataobjectYes

The DNS record information. The format of this field varies based on the record type. For more information, see Add DNS records.

ValuestringNo

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:

  • A/AAAA: the IP address(es). Separate multiple IPs with commas (,). You must have at least one IPv4 address.
  • CNAME: the target domain name.
  • NS: the name servers for the domain name.
  • MX: a valid domain name of the target mail server.
  • TXT: a valid text string.
  • CAA: a valid domain name of the certificate authority.
  • SRV: a valid domain name of the target host.
  • URI: a valid URI string.
example.com
PriorityintegerNo

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
FlagintegerNo

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
TagstringNo

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
WeightintegerNo

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
PortintegerNo

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
TypeintegerNo

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
KeyTagintegerNo

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
AlgorithmintegerNo

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
CertificatestringNo

The public key of the certificate. This parameter is required when you add CERT, SMIMEA, or TLSA records.

dGVzdGFkYWxrcw==
UsageintegerNo

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
SelectorintegerNo

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
MatchingTypeintegerNo

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
FingerprintstringNo

The public key fingerprint of the record. This parameter is required when you add a SSHFP record.

abcdef1234567890
SourceTypestringNo

The type of the origin for the CNAME record. This parameter is required when you add a CNAME record. Valid values:

  • OSS : OSS origin.
  • S3 : S3 origin.
  • LB: Load Balancer origin.
  • OP: origin in an origin pool.
  • Domain: common domain name.

If you leave the parameter empty or set its value as null, the default is Domain, which is common domain name.

OSS
BizNamestringNo

The business scenario of the record for acceleration. Leave the parameter empty if your record is not proxied. Valid values:

  • video_image: video and image.
  • api: API.
  • web: web page.
web
CommentstringNo

The comments of the record.

This is a remark.
AuthConfobjectNo

The origin authentication information of the CNAME record.

AuthTypestringNo

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:

  • public: public read. Select this value when the origin type is OSS or S3 and the origin access is public read.
  • private: private read. Select this value when the origin type is S3 and the origin access is private read.
  • private_same_account: private read under the same account. Select this value when the origin type is OSS, the origins belong to the same Alibaba Cloud account, and the origins have private read access.
private
SecretKeystringNo

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
AccessKeystringNo

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
RegionstringNo

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:

  • v2
  • v4

If you leave this parameter empty, the default value v4 is used.

v2
VersionstringNo

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
HostPolicystringNo

The origin host policy. This policy takes effect when the record type is CNAME. You can set the policy in two modes:

  • follow_hostname: match the requested domain name.
  • follow_origin_domain: match the origin's domain name.
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

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

0AEDAF20-4DDF-4165-8750-47FF9C1929C9

Examples

Sample success responses

JSONformat

{
  "RequestId": "0AEDAF20-4DDF-4165-8750-47FF9C1929C9"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterThe specified parameter is invalid.The specified parameter is invalid.
400ServiceInvokeFailedThe 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.
400InternalExceptionFailed to call the service. Try again later or contact technical support.Failed to call the service. Try again later or contact technical support.
400NoPermissionYou 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.
400InvalidParameter.RecordDataInvalid record content. Adjust your configurations based on the API documentation.Invalid record content. Adjust your configurations based on the API documentation.
400Instance.NotOnlineYour 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.
400Record.ReservedAnother operation on the record is in progress. Try again later.Another operation on the record is in progress. Try again later.
400Record.ServiceBusyThe record is being configured. Try again later.The record is being configured. Try again later.
400Record.ConflictThe 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.
400SourceCircleExistThe 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.
404Record.NotFoundThe 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 timeSummary of changesOperation
2024-10-10The Error code has changedView Change Details
2024-09-24The Error code has changedView Change Details
2024-09-23The Error code has changed. The request parameters of the API has changedView Change Details