Search code examples
dnsgoogle-cloud-dns

How to change TTL of current records in Google Cloud DNS?


How can the TTL of current records in Google Cloud DNS be changed? The TTL of the zone can be changed through the gcloud dns records --zone=zone edit command, by changing the ttl without adding any records. For existing records, do we need to delete then re-add them?


Solution

  • To edit an existing record, you are correct that you delete the existing record and add the updated version. See the example in the documentation here: https://cloud.google.com/dns/records/#creating_editing_and_deleting_records

    If you want to edit another record, put it in the 'deletions' list. Also put it in the 'additions' list and update the TTL there.