Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud DNS
  • Getting started
    • All guides
      • Creating a private DNS zone
      • Creating a public DNS zone
      • Updating a DNS zone
      • Configuring DNS zone access permissions
      • Viewing operations with DNS zones
      • Deleting a DNS zone
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Zones
  3. Creating a private DNS zone

Creating a private DNS zone

Written by
Yandex Cloud
Updated at May 5, 2025

To create a private DNS zone:

Management console
CLI
Terraform
API
  1. In the management console, select the folder where you need to create a DNS zone.
  2. Select Cloud DNS.
  3. Click Create zone.
  4. Specify the zone settings:
    1. Zone: Domain zone. The zone name must end with a period. You cannot create public top-level domain (TLD) zones. To create a domain zone with non-Latin characters, use the Punycode encoding.
    2. Type: Internal.
    3. Specify the networks whose resources will be included in the zone being created.
    4. Name of the zone.
  5. Click Create.

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

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

To create a new DNS zone:

  1. View a description of the CLI create zone command:

    yc dns zone create --help
    
  2. Create a new private DNS zone in the default folder:

    yc dns zone create --name <zone_name> \
      --zone <domain_zone>. \
      --private-visibility=true \
      --network-ids="<network_1_ID>","<network_2_ID>"
    

    Where:

    • --name: Zone name. It must be unique within the folder. This is an optional parameter.
    • --zone: Domain zone. The zone name must end with a period. You cannot create public top-level domain (TLD) zones. To create a domain zone with non-Latin characters, use the Punycode encoding. This is a required parameter.
    • --private-visibility: Flag for creating a private zone.
    • --network-ids: IDs of the networks whose resources will be included in the zone.

    Result:

    id: aet29qhara5j********
    folder_id: aoerb349v3h4********
    created_at: "2021-02-21T09:21:03.935Z"
    name: test-zone
    zone: staging.
    private_visibility:
      network_ids:
      - c645mh47vsc********
      - b335fbs4fvv********
    

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

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

  1. In the configuration file, describe the parameters of the resources you want to create:

    resource "yandex_dns_zone" "zone1" {
      name        = "<zone_name>"
      description = "<zone_description>"
    
      labels = {
        label1 = "<zone_label>"
      }
    
      zone    = "<domain_zone>."
      public           = false
      private_networks = ["<network_1_ID>","<network_2_ID"]
    }
    

    Where:

    • name: Zone name. It must be unique within the folder. This is an optional parameter.
    • description: Zone description. This is an optional parameter.
    • labels: DNS zone labels. This is an optional parameter.
    • zone: Domain zone. The zone name must end with a period. You cannot create public top-level domain (TLD) zones. To create a domain zone with non-Latin characters, use the Punycode encoding. This is a required parameter.
    • public: Zone visibility, public or private. This is an optional parameter.
    • private_networks: IDs of the networks that have access to domain names within this zone. This is an optional parameter.

    For more information about the yandex_dns_zone resource properties, see the provider documentation.

  2. Create resources:

    1. In the terminal, change to the folder where you edited the configuration file.

    2. Make sure the configuration file is correct using the command:

      terraform validate
      

      If the configuration is correct, the following message is returned:

      Success! The configuration is valid.
      
    3. Run the command:

      terraform plan
      

      The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

    Terraform will create all the required resources. You can check the new resources using the management console or this CLI command:

    yc dns zone get <zone_name>
    

To create a private DNS zone, use the create REST API method for the DnsZone resource or the DnsZoneService/Create gRPC API call.

Was the article helpful?

Previous
All guides
Next
Creating a public DNS zone
© 2025 Direct Cursus Technology L.L.C.