Deleting a resource record
To delete a resource record:
- In the management console
, select the folder containing the DNS zone with the record you want to delete. - Select Cloud DNS.
- Select the zone from the list.
- Find the record you want to delete and click
in its row. - In the menu that opens, click Delete.
- In the window that opens, click Delete.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI command for deleting a record:
yc dns zone delete-records --help
-
Get a list of all zone records:
yc dns zone list-records --name <zone_name>
-
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:
-
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"] } ...
-
In the command line, navigate to the directory with the Terraform configuration file.
-
Check the configuration using this command:
terraform validate
If the configuration is correct, you will get this message:
Success! The configuration is valid.
-
Run this command:
terraform plan
You will see a detailed list of resources. No changes will be made at this step. If the configuration contains errors, Terraform will show them.
-
Apply the changes:
terraform apply
-
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 the updateRecordSets REST API method for the DnsZone resource or the DnsZoneService/UpdateRecordSets gRPC API call.