[Yandex Cloud documentation](../../index.md) > [Yandex Cloud DNS](../index.md) > [Step-by-step guides](index.md) > Zones > Deleting a DNS zone

# Deleting a DNS zone

To delete a [DNS zone](../concepts/dns-zone.md):

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder containing your DNS zone.
  1. Navigate to **Cloud DNS**.
  1. Find the zone you want to delete and click ![image](../../_assets/console-icons/ellipsis.svg) in its row.
  1. In the menu that opens, click **Delete**.
  1. In the window that opens, click **Delete**.

- 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.

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

      ```
      yc dns zone delete --help
      ```
  1. Get a list of all DNS zones in the default folder:

      ```
      yc dns zone list
      ```
  1. Select the zone `ID` or `NAME`.
  1. Delete the zone from the default folder:

      ```
      yc dns zone delete <zone_name_or_ID>
      ```

- 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 delete a DNS zone created with Terraform:

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

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

     ```hcl
     resource "yandex_vpc_network" "foo" {}
     
     resource "yandex_dns_zone" "zone1" {
       name        = "my-public-zone"
       description = "Test public zone"
     
       labels = {
         label1 = "test-public"
       }
     
       zone    = "test.example-public2.com."
     }
     ```

     {% endcut %}

  1. In the command line, navigate to the directory with the Terraform configuration file.

  1. Check the configuration using this command:
     ```
     terraform validate
     ```
     
     If the configuration is valid, you will get this message:
     
     ```
     Success! The configuration is valid.
     ```

  1. 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.

  1. Apply the configuration changes:
     ```
     terraform apply
     ```
     
  1. Type `yes` and press **Enter** to confirm changes.

     You can check whether the DNS zone was successfully deleted in the [management console](https://console.yandex.cloud) or using this [CLI](../../cli/quickstart.md) command:

     ```
     yc dns zone list
     ```

- API {#api}

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

{% endlist %}