Deleting a resource record
To delete a resource record:
- In the management console
, select the folder containing the DNS zone to delete a record from. - Select Cloud DNS.
- Select the zone from the list.
- Click
in the row next to the record to delete. - In the menu that opens, click Delete.
- In the window that opens, click Delete.
If you do not 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.
-
View a description of the CLI delete record command:
yc dns zone delete-records --help
-
Get a list of all records in the zone:
yc dns zone list-records --name <zone_name>
-
Delete a record:
yc dns zone delete-records --name <zone_name> \ --record "<domain_name> <TTL> <record_type> <value>"
If you don't have Terraform, install it and configure the Yandex Cloud provider.
To delete a record created using Terraform from the DNS zone:
-
Open the Terraform configuration file and delete 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"] } ...
-
In the command line, go 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
The terminal will display a list of resources with parameters. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
into the terminal and press Enter.You can check the update using the management console
or 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.