All Products
Search
Document Center

Alibaba Cloud DNS:UpdateZoneRecord

Last Updated:Nov 25, 2024

Modifies a Domain Name System (DNS) record of a zone, including the hostname, record value, and weight value of the DNS record.

Operation description

Precautions

The DNS record modification for a zone in the regular module takes effect only after the time to live (TTL) expires. The DNS record modification for a zone in the acceleration module takes effect immediately.

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:
    • The required resource types are displayed in bold characters.
    • 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
pvtz:UpdateZoneRecordupdate
*Zone
acs:pvtz::{#accountId}:zone/{#ZoneId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RrstringYes

The hostname. The hostname is the prefix of the subdomain name for zone. Example: www, @, * (used for wildcard DNS resolution), and mail (used for specifying the mail server that receives emails).

For example, if you want to resolve the domain name @.exmaple.com, you must set Rr to @ instead of leaving Rr empty.

www
LangstringNo

The language of the response. Valid values:

  • zh: Chinese
  • en: English

Default value: en.

en
RecordIdlongYes

The ID of the DNS record. You can call the DescribeZoneRecords operation to query a list of DNS records.

172223****
LinestringNo

The resolution line. Default value: default.

default
WeightintegerNo

The weight value of the address. You can set a different weight value for each address. This way, addresses are returned based on the weight values for DNS requests. A weight value must be an integer that ranges from 1 to 100.

1
TypestringYes

The type of the DNS record. Valid values:

  • A: An A record maps a domain name to an IPv4 address in the dotted decimal notation format.
  • AAAA: An AAAA record maps a domain name to an IPv6 address.
  • CNAME: A canonical name (CNAME) record maps a domain name to another domain name.
  • TXT: A text (TXT) record usually serves as a Sender Policy Framework (SPF) record to prevent email spam. The record value of the TXT record can be up to 255 characters in length.
  • MX: A mail exchanger (MX) record maps a domain name to the domain name of a mail server.
  • PTR: A pointer (PTR) record maps an IP address to a domain name.
  • SRV: A service (SRV) record specifies a server that hosts a specific service. Enter a record value in the format of Priority Weight Port Destination domain name. Separate these items with spaces.
Note Before you add a PTR record, you must configure a reverse lookup zone. For more information, see Add PTR records.
A
TtlintegerNo

The TTL period. Valid values: 5, 30, 60, 3600, 43200, and 86400. Unit: seconds.

60
PriorityintegerNo

The priority of the MX record. You can set priorities for different email servers. Valid values: 1 to 99. A smaller value indicates a higher priority.

Note This parameter is required if the type of the DNS record is MX.
60
ValuestringYes

The record value. You need to enter the record value based on the DNS record type.

192.16.XX.XX
UserClientIpstringNo

The IP address of the client.

127.0.XX.XX
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

6447728c8578e66aacf062d2df4446dc

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

250E2C38-D0AD-4518-851D-1C1055805F82
RecordIdlong

The ID of the DNS record.

172223****

Examples

Sample success responses

JSONformat

{
  "RequestId": "250E2C38-D0AD-4518-851D-1C1055805F82",
  "RecordId": 0
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history