Edit or delete a record
Change the values or TTL of a record set, or delete the set.
Replace zone-id with the id of your hosted zone and record-id with the id of the record set
(dcloud dns records list zone-id lists them). The name and type of a set cannot change:
to move a record, add a new set and delete the old one.
Prerequisites
- Permission for
dns:ChangeRecordson the zone. Without it, Edit record and Delete record are unavailable, with the note "Adding, editing or deleting a record set needs dns:ChangeRecords on this zone. Ask an administrator." - In the console, also
dns:ListZonesto open Hosted zones (without it the page shows an access-denied notice),dns:GetZoneto open the zone (without it the zone's page is not found) anddns:ListRecordsto see the zone's records.
Edit a record set
Fields you leave out keep their stored value.
- Open the zone. On the Records tab, in the row's actions menu, choose Edit record.
- Change Values, one per line or TTL (seconds). Name and Type cannot be changed.
- Choose Save.
dcloud dns records update zone-id record-id --values 192.0.2.20 --ttl 300PUT /dns/api/zones/zone-id/records/record-id
{ "values": ["192.0.2.20"], "ttl": 300 }The answer is 200 with the set as stored.
Change values, ttl or the target arguments of the dcloud_dns_record and run
terraform apply. Changing name, type or zone_id replaces the record.
An edit is checked like an add (see Add a record) and refused with 400 and
the same reasons. It never counts against the zone's quota. To remove a health check with the API,
send "healthCheckId": null together with "failoverValues": []; with failover values still
stored, the edit is refused with "Failover values need a health check".
Delete a record set
- Open the zone. On the Records tab, in the row's actions menu, choose Delete record.
- In the dialog Delete record set, choose Delete.
If the delete fails, the reason appears above the table, after "The record set was not deleted:".
dcloud dns records delete zone-id record-idDELETE /dns/api/zones/zone-id/records/record-idRemove the dcloud_dns_record resource and run terraform apply.
Result
The nameservers answer the change on their next pull. Resolvers that cached the old answer keep it
until its TTL runs out; after a delete they then get no answer for that name and type. Deleting an
ALIAS to a bucket website also removes the name from the bucket's website domains.
The platform's apex NS row in the console has no actions: it is set by the platform.
A request for a zone or set that does not exist is refused with 404 "Zone not found" or
"Record not found".