Updating a DNS zone
You can rename or add a descriptoin to an existing DNS zone.
To update a DNS zone:
- In the management console
, select the folder containing the DNS zone you want to update. - Select Cloud DNS.
- Find the zone you want to update and click
in its row. - In the menu that opens, click Edit.
- Edit zone settings as needed.
- Click Save.
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.
To update a DNS zone:
-
See the description of the CLI command for updating a DNS zone:
yc dns zone update --help
-
Configure DNS zone visibility settings for specific networks:
yc dns zone update <zone_name_or_ID> --network-ids=<zone_network_IDs>,
Where
--network-ids
is a list of network IDs authorized to access this DNS zone.Result:
id: aet29qhara5j******** folder_id: aoerb349v3h4******** created_at: "2021-02-21T09:21:03.935Z" name: new-zone-name zone: staging. private_visibility: network_ids: - c645mh47vsc********
If you do not have Terraform yet, install it and configure its Yandex Cloud provider.
To update a DNS zone created with Terraform:
-
Open the Terraform configuration file and edit the fragment describing the DNS zone.
Terraform DNS zone description example
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." }
-
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.
-
Type
yes
and press Enter to confirm changes.You can check whether the DNS zone has been successfully updated in the management console
or using this CLI command:yc dns zone get <zone_name>
To update a DNS zone, use the update REST API method for the DnsZone resource or the DnsZoneService/Update gRPC API call.