dns.records.update

Change the values or TTL of a record set

PUT /dns/api/zones/{id}/records/{recordId}IAM dns:ChangeRecordsChanges stateDestructive

Fields left out keep their stored value. An ALIAS target sent here replaces the old one; healthCheckId null removes the check, but stored failoverValues must be cleared in the same call (failoverValues: []) or the change is refused.

Request syntax

PUT /dns/api/zones/{id}/records/{recordId}
{
  "ttl": "number",
  "values": "array of string",
  "appId": "string",
  "loadBalancerId": "string",
  "bucket": "string",
  "distributionId": "string",
  "healthCheckId": "string",
  "failoverValues": "array of string",
  "routing": "object"
}

Path parameters

  • idRequired

    string

    Constraints: uuid

  • recordIdRequired

    string

    Constraints: uuid

Request body

  • ttlOptional

    number

    Seconds resolvers may cache the set, 1 to 604800. Absent: the TTL is kept

    Constraints: integer, 1-604800

  • valuesOptional

    array of string

    Replaces the values (at most 100 of at most 4096 characters each; a CNAME takes one). Absent: the values are kept. The name and type of a set cannot change

    Constraints: 1-4096 chars

  • appIdOptional

    string

    ALIAS: the app whose address is answered

  • loadBalancerIdOptional

    string

    ALIAS: a load balancer, answered with its IPv4 (A) and IPv6 (AAAA)

  • bucketOptional

    string

    ALIAS: a bucket name; the name answers with the bucket's static website

  • distributionIdOptional

    string

    ALIAS: a CDN distribution, answered with its healthy edge nodes (TTL at most 30 s); list the name among the distribution's aliases too, for its certificate

  • healthCheckIdOptional

    string

    A, AAAA, CNAME: an uptime check; null removes it

    May be null.

  • failoverValuesOptional

    array of string

    Answered instead of values while the health check is down

  • routingOptional

    object

    Weighted ({policy:"weighted", variants:[{id, weight 0-255, values, healthCheckId?}]}) or geolocation ({policy:"geo", variants:[{id, country|continent, values, healthCheckId?}]}) routing; null removes it. For geo, values are the default answer.

    Constraints: JSON

    May be null.

Response

200 with the record set as stored: id, zoneId, name (fully qualified), type, ttl, values, aliasAppId, aliasLoadBalancerId, aliasBucketId, aliasDistributionId, healthCheckId, failoverValues, routing, createdAt, updatedAt. 400 with the reason when the result does not validate (as for set); 404 when the zone or the record set does not exist.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow dns:ChangeRecords on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud dns records update id recordId

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_dns_records_update.