v8

latestOpenAPI 3.0.0Apache 2.0raw.githubusercontent.com2025-10-165266542.4 MB
DigitalOcean-public.v2-new_Domain Records

Update a Domain Record

To update an existing record, send a PUT request to /v2/domains/$DOMAIN_NAME/records/$DOMAIN_RECORD_ID. Any attribute valid for the record type can be set to a new value for the record.

See the attribute table for details regarding record types and their respective attributes.

put/v2/domains/{domain_name}/records/{domain_record_id}

Path parameters

domain_namestring required

The name of the domain itself.

domain_record_idinteger required

The unique identifier of the domain record.

Request body

idinteger

A unique identifier for each domain record.

typestring required

The type of the DNS record. For example: A, CNAME, TXT, ...

namestring

The host name, alias, or service being defined by the record.

datastring

Variable data depending on record type. For example, the "data" value for an A record would be the IPv4 address to which the domain will be mapped. For a CAA record, it would contain the domain name of the CA being granted permission to issue certificates.

priorityinteger nullable

The priority for SRV and MX records.

portinteger nullable

The port for SRV records.

ttlinteger

This value is the time to live for the record, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.

weightinteger nullable

The weight for SRV records.

flagsinteger nullable

An unsigned integer between 0-255 used for CAA records.

tagstring nullable

The parameter tag for CAA records. Valid values are "issue", "issuewild", or "iodef"

Example request

{
  "id": 28448429,
  "type": "NS",
  "name": "@",
  "data": "ns1.digitalocean.com",
  "ttl": 1800
}

Response

The response will be a JSON object with a key called domain_record. The value of this will be a domain record object which contains the standard domain record attributes.

Example response

{
  "domain_record": {
    "id": 3352896,
    "type": "A",
    "name": "blog",
    "data": "162.10.66.0",
    "priority": null,
    "port": null,
    "ttl": 1800,
    "weight": null,
    "flags": null,
    "tag": null
  }
}