Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
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. Deleting a record

Deleting a resource record

Written by
Yandex Cloud
Updated at May 5, 2026

To delete a resource record:

Management console
CLI
Terraform
API
  1. In the management console, select the folder containing the DNS zone with the record you want to delete.
  2. Select Cloud DNS.
  3. Select the zone from the list.
  4. Find the record you want to delete and click in its row.
  5. In the menu that opens, click Delete.
  6. In the window that opens, click Delete.

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

The folder used by default is the one specified when creating 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.

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

    yc dns zone delete-records --help
    
  2. Get a list of all zone records:

    yc dns zone list-records --name <zone_name>
    
  3. If the record has a description, clear it before deletion:

    yc dns zone add-records --name <zone_name> \
    --record "<domain_name> <TTL> <record_type> <value>" \
    --description ""
    
  4. Delete the record:

    yc dns zone delete-records --name <zone_name> \
    --record "<domain_name> <TTL> <record_type> <value>"
    

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

To delete a DNS resource record created with Terraform, do the following:

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

    Terraform DNS record description example
    ...
    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"
    }
    ...
    
  2. In the command line, navigate to the directory with the Terraform configuration file.

  3. Check the configuration using this command:

    terraform validate
    

    If the configuration is valid, you will get this message:

    Success! The configuration is valid.
    
  4. Run this command:

    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.

  5. Apply the configuration changes:

    terraform apply
    
  6. Type yes and press Enter to confirm changes.

    You can check the updates in the management console or using this CLI command:

    yc dns zone list-records <zone_name>
    

To delete a resource record, use one of the following methods:

  • upsertRecordSets: The move REST API method for the DnsZone resource or the DnsZoneService/UpsertRecordSets gRPC API call. The method does not require an exact match of the description field.

  • updateRecordSets: The move REST API method for the DnsZone resource or the DnsZoneService/UpdateRecordSets gRPC API call. The method requires an exact match of all the record's fields, including description.

REST API example for the upsertRecordSets methodREST API example for the upsertRecordSets method

Below is an example of a Bash script for Linux.

To use it, get authenticated with the API and install cURL.

  1. Create a script file:

    sudo touch <file_name>
    
  2. Open the file to write the script to:

    sudo nano <file_name>
    
  3. Place the script in the file:

    #!/bin/bash
    
    # Creating variables
    
    export IAM_TOKEN=$(yc iam create-token)
    
    dnsZoneId='<DNS_zone_ID>'
    recordName='<domain_name>'
    recordType='<record_type>'
    recordTtl='<TTL>'
    recordData='<value>'
    
    # Deleting a record via upsertRecordSets
    
    curl \
      --request POST \
      --header "Authorization: Bearer ${IAM_TOKEN}" \
      --header "Content-Type: application/json" \
      --data '{
        "deletions": [
          {
            "name": "'"${recordName}"'",
            "type": "'"${recordType}"'",
            "ttl": "'"${recordTtl}"'",
            "data": ["'"${recordData}"'"]
          }
        ]
      }' \
      "https://dns.api.cloud.yandex.net/dns/v1/zones/${dnsZoneId}:upsertRecordSets"
    

    Where:

    • IAM_TOKEN: IAM token for API authentication.
    • dnsZoneId: DNS zone ID. To find out the ID, get a list of DNS zones.
    • recordName: Record domain name, e.g., srv.example.com..
    • recordType: Entry type, e.g., A.
    • recordTtl: Record lifetime (TTL) in seconds, e.g., 600.
    • recordData: Record value, e.g., 10.1.0.1.

    Tip

    To use the updateRecordSets method, replace upsertRecordSets in the URL with updateRecordSets. Note that in this case, all the record's fields, including description, must match exactly.

  4. Make the file executable:

    chmod +x <file_name>
    
  5. Run the script:

    ./<file_name>
    

This will return an operation in JSON format:

{
  "id": "dns1234567890abcdef",
  "description": "",
  "createdAt": "2025-01-15T12:00:00.000000000Z",
  "createdBy": "aje1234567890abcdef",
  "modifiedAt": "2025-01-15T12:00:00.000000000Z",
  "done": true,
  "metadata": {},
  "response": {
    "@type": "type.googleapis.com/yandex.cloud.dns.v1.RecordSetDiff",
    "additions": [],
    "deletions": [
      {
        "name": "srv.example.com.",
        "type": "A",
        "ttl": "600",
        "data": ["10.1.0.1"]
      }
    ]
  }
}

Where:

  • id: Unique operation ID.
  • done: Operation completion status.
  • response.deletions: List of deleted records.

gRPC API example for the upsertRecordSets methodgRPC API example for the upsertRecordSets method

Below is an example Bash script for calling the gRPC API using grpcurl.

  1. Install grpcurl:

    • Using Bash:

      curl -L https://github.com/fullstorydev/grpcurl/releases/download/v1.9.3/grpcurl_1.9.3_linux_x86_64.tar.gz | tar -xz
      sudo mv grpcurl /usr/local/bin/
      
    • Using Golang:

      go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
      
  2. Create a script file:

    sudo touch <file_name>
    
  3. Open the file to write the script to:

    nano <file_name>
    
  4. Place the script in the file:

    #!/bin/bash
    
    # Creating variables
    
    export IAM_TOKEN=$(yc iam create-token)
    
    dnsZoneId='<DNS_zone_ID>'
    recordName='<domain_name>'
    recordType='<record_type>'
    recordTtl='<TTL>'
    recordData='<value>'
    
    # Deleting a record via UpsertRecordSets
    
    grpcurl \
      -d "{
        \"dns_zone_id\": \"${dnsZoneId}\",
        \"deletions\": [
          {
            \"name\": \"${recordName}\",
            \"type\": \"${recordType}\",
            \"ttl\": \"${recordTtl}\",
            \"data\": [\"${recordData}\"]
          }
        ]
      }" \
      -H "authorization: Bearer ${IAM_TOKEN}" \
      -H "x-client-request-id: $(uuidgen)" \
      dns.api.cloud.yandex.net:443 \
      yandex.cloud.dns.v1.DnsZoneService/UpsertRecordSets
    

    Where:

    • IAM_TOKEN: IAM token for API authentication.
    • dnsZoneId: DNS zone ID. To find out the ID, get a list of DNS zones.
    • recordName: Record domain name, e.g., srv.example.com..
    • recordType: Entry type, e.g., A.
    • recordTtl: Record lifetime (TTL) in seconds, e.g., 600.
    • recordData: Record value, e.g., 10.1.0.1.
    • x-client-request-id: Unique request ID for tracing.

    Tip

    To use the UpdateRecordSets method, replace UpsertRecordSets in the script with UpdateRecordSets. Note that in this case, all the record's fields, including description, must match exactly.

  5. Make the file executable:

    chmod +x <file_name>
    
  6. Run the script:

    ./<file_name>
    

This will return an operation in JSON format:

{
  "id": "dns1234567890abcdef",
  "description": "",
  "createdAt": "2025-01-15T12:00:00.000000000Z",
  "createdBy": "aje1234567890abcdef",
  "modifiedAt": "2025-01-15T12:00:00.000000000Z",
  "done": true,
  "metadata": {
    "@type": "type.googleapis.com/yandex.cloud.dns.v1.UpsertRecordSetsMetadata"
  },
  "response": {
    "@type": "type.googleapis.com/yandex.cloud.dns.v1.RecordSetDiff",
    "additions": [],
    "deletions": [
      {
        "name": "srv.example.com.",
        "type": "A",
        "ttl": "600",
        "data": ["10.1.0.1"]
      }
    ]
  }
}

Where:

  • id: Unique operation ID.
  • done: Operation completion status.
  • metadata: Operation metadata.
  • response.deletions: List of deleted records.

For a detailed method description, see the gRPC API reference.

Was the article helpful?

Previous
Updating a record
Next
Overview
© 2026 Direct Cursus Technology L.L.C.