Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Cloud DNS
  • Getting started
    • All guides
      • Creating a record
      • Updating a record
      • Deleting a record
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Records
  3. Updating a record

Updating a resource record

Written by
Yandex Cloud
Updated at May 5, 2025

You can update the value of a resource record. To update a record:

Management console
CLI
Terraform
API
  1. In the management console, select a folder to modify the DNS zone record in.
  2. Select Cloud DNS.
  3. Select the zone from the list.
  4. Click next to the record you need and select Edit.
  5. Change the record TTL or value.
  6. Click Save.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To update a DNS zone:

  1. View a description of the CLI update record command:

    yc dns zone replace-records --help
    
  2. Change the record value:

    yc dns zone replace-records --name <zone_name> \
    --record "<domain_name> 600 <record_type> <new_value>"
    

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

To update a DNS record created using Terraform:

  1. Open the Terraform configuration file and edit the fragment with the DNS record description.

    Example DNS record description in the Terraform configuration
    ...
    resource "yandex_dns_recordset" "rs1" {
      zone_id = yandex_dns_zone.zone1.id
      name    = "srv.example.com."
      type    = "A"
      ttl     = 200
      data    = ["10.1.0.1"]
    }
    ...
    
  2. Check the configuration using this command:

  3. Apply the changes:

    1. In the terminal, change to the folder where you edited the configuration file.

    2. Make sure the configuration file is correct using the command:

      terraform validate
      

      If the configuration is correct, the following message is returned:

      Success! The configuration is valid.
      
    3. Run the command:

      terraform plan
      

      The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

    You can check the DNS record update in the management console or using the CLI command below:

    yc dns zone list-records <zone_name>
    

To update a resource record, use the updateRecordSets REST API method for the DnsZone resource or the DnsZoneService/UpdateRecordSets gRPC API call.

The value of resource TXT records cannot contain more than 255 characters per line and 1024 characters total. If the new value contains more characters, split it into multiple values.

Note

You cannot modify a service resource record.

Was the article helpful?

Previous
Creating a record
Next
Deleting a record
Yandex project
© 2025 Yandex.Cloud LLC