Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Blog
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
Yandex project
© 2023 Intertech Services AG
Yandex Cloud DNS
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Zones
    • Records
      • Creating a record
      • Updating a record
      • Deleting a record
  • Concepts
  • Practical guidelines
  • Access management
  • Pricing policy
  • API reference
  • Questions and answers
  1. Step-by-step instructions
  2. Records
  3. Updating a record

Updating a resource record

Written by
Yandex Cloud

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

    Management console
    CLI
    Terraform
    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 desired record and select Edit.
    5. Change the record's TTL or value.
    6. Click Save.

    If you don't have the Yandex Cloud command line interface yet, install and initialize it.

    The folder specified in the CLI profile is used by default. 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 "<record domain name> 600 <record type> <new record value>"
      

    For more information about the Terraform, see the documentation.

    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 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 into the terminal and press Enter.

      You can verify that the DNS record has been updated in the management console or using the CLI command below:

      yc dns zone list-records <DNS zone name>
      

    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.

    Was the article helpful?

    Language / Region
    Yandex project
    © 2023 Intertech Services AG