Creates a DNS record for a specific website.
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 Resourcesis 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:CreateRecord | create | *Site acs:esa:{#regionId}:{#accountId}:site/{#SiteId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| SiteId | long | Yes | The website ID, which can be obtained by calling the ListSites operation. | 1234567890123 |
| RecordName | string | Yes | The record name. | www.example.com |
| Proxied | boolean | No | Specifies whether to proxy the record. Only CNAME and A/AAAA records can be proxied. Valid values:
| true |
| Type | string | Yes | The type of the DNS record. For example, A/AAAA, TXT, MX, or CNAME. | A/AAAA |
| SourceType | string | No | The origin type for the CNAME record. This parameter is required when you add a CNAME record. Valid values:
If you do not pass this parameter or if you leave its value empty, Domain is used by default. | 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 |
| Ttl | integer | No | The TTL of the record. Unit: seconds. If the value is 1, the TTL of the record is determined by the system. | 30 |
| Data | object | Yes | The DNS record information. The format of this field varies based on the record type. For more information, see References . | |
| Value | string | No | 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 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. Valid values:
| 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. | RSA |
| 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. | 1 |
| 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. | 1 |
| 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. | 1 |
| 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. | 1 |
| Fingerprint | string | No | The public key fingerprint of the record. This parameter is required when you add a SSHFP record. | abcdef1234567890 |
| Comment | string | No | The comment of the record. The maximum length is 100 characters. | 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 |
| 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_cross_account, or when the SourceType is S3 and AuthType is private. | u0Nkg5gBK*******QF5wvKMM504JUHt |
| 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. | VIxuvJSA2S03f******kp208dy5w7 |
| Version | 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. | v4 |
| Region | 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 References .
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "F61CDR30-E83C-4FDA-BF73-9A94CDD44229",
"RecordId": 1234567890123
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 400 | InvalidParameter.InvalidRecordName | The record name you entered does not meet the specifications. Change the record name according to the product documentation. | The record name you entered does not meet the specifications. Please adjust the record name according to the product documentation. |
| 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 | 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 | InvalidParameter.RecordType | Invalid record type. Adjust your configurations based on the API documentation. | Invalid record type. 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 | QuotaExceed.RecordCount | The maximum number of records has been reached. Delete some and try again or upgrade your plan. | The maximum number of records has been reached. Delete some and try again or upgrade your plan. |
| 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 | Site.ServiceBusy | This website is being configured. Try again later. | This website is being configured. Try again later. |
| 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. |
| 400 | QuotaExceed.WildCardRecord | The maximum number of wildcard records has been reached. Delete some and try again. | The maximum number of wildcard records has been reached. Delete some and try again. |
| 400 | WildcardRecordsExceedLimit | The number of pan records currently added has exceeded the system limit. If you want to add more pan records, please contact the background with a work order. | The number of pan records currently added has exceeded the system limit. If you want to add more pan records, please contact the background with a work order. |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-02-18 | The Error code has changed | View Change Details |
| 2024-11-05 | The Error code has changed | View Change Details |
| 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 |
