[Yandex Cloud documentation](../../index.md) > [Yandex Cloud DNS](../index.md) > [Step-by-step guides](index.md) > Records > Updating a record

# Updating a resource record

You can update the value of a [resource record](../concepts/resource-record.md). To update a record:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select a folder to modify the DNS zone record in.
  1. Navigate to **Cloud DNS**.
  1. Select the zone from the list.
  1. Click ![image](../../_assets/console-icons/ellipsis.svg) next to the record you need and select ![image](../../_assets/console-icons/pencil.svg) **Edit**.
  1. Edit the record TTL, value, or description.
  1. Click **Save**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  To update a DNS zone:

  1. See the description of the CLI command for updating a resource record:

     ```bash
     yc dns zone replace-records --help
     ```

  1. Change the record value:

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

    Where:

    * `--name`: Zone name. It must be unique within a folder.
    * `--record`: DNS record containing the domain name, TTL, record type, and record value.
    * `--description`: Description for the new records. If this parameter is not set, the description will be an empty string. This is an optional setting.


- Terraform {#tf}

  If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
  
  
  To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../terraform/authentication.md) using the appropriate method.

  To update a DNS record created with Terraform:

  1. Open the Terraform configuration file and edit the fragment describing your DNS record.

     {% cut "Terraform DNS record description example" %}

     ```hcl
     ...
     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"]
       description = "Web server A record"
     }
     ...
     ```

     {% endcut %}

  1. Check the configuration using this command:

     ```bash
     terraform validate
     ```

  1. Apply the changes:

      1. In the terminal, navigate to the configuration file directory.
      1. Make sure the configuration is correct using this command:
      
         ```bash
         terraform validate
         ```
      
         If the configuration is valid, you will get this message:
      
         ```bash
         Success! The configuration is valid.
         ```
      
      1. Run this command:
      
         ```bash
         terraform plan
         ```
      
         You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.
      1. Apply the configuration changes:
      
         ```bash
         terraform apply
         ```
      
      1. Type `yes` and press **Enter** to confirm the changes.

     You can verify DNS record changes in the [management console](https://console.yandex.cloud) or using this [CLI](../../cli/quickstart.md) command:

     ```bash
     yc dns zone list-records <zone_name>
     ```

- API {#api}

  To update a DNS resource record, use the [updateRecordSets](../api-ref/DnsZone/updateRecordSets.md) REST API method for the [DnsZone](../api-ref/DnsZone/index.md) resource or the [DnsZoneService/UpdateRecordSets](../api-ref/grpc/DnsZone/updateRecordSets.md) gRPC API call.

{% endlist %}

The value of resource [TXT records](../concepts/resource-record.md#txt) 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 info %}

You cannot modify [service resource records](../concepts/resource-record.md#service-records).

{% endnote %}