Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI Studio
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 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 public DNS zone

Creating a public DNS zone

Written by
Yandex Cloud
Updated at July 29, 2025

To create a public DNS zone:

Management console
CLI
Terraform
API
  1. In the management console, select the folder where you want to create your DNS zone.
  2. Select Cloud DNS.
  3. Click Create zone.
  4. Specify zone settings:
    1. Zone: Domain zone name. Note that it must end with a trailing dot. You cannot create top-level domain (TLD) zones. To create a domain name with non-Latin characters, use Punycode encoding.
    2. Type: Public.
    3. Name of the zone.
  5. Click Create.

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 create a new DNS zone:

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

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

    yc dns zone create --name <zone_name> \
      --zone <domain_zone>. \
      --public-visibility=true
    

    Where:

    • --name: Zone name. Note that the zone name must be unique within a folder. This is an optional parameter.
    • --zone: Domain zone name. Note that it must end with a trailing dot. You cannot create top-level domain (TLD) zones. To create a domain name with non-Latin characters, use Punycode encoding. This is a required setting.
    • --public-visibility: Enable this flag to create a public zone.

    Result:

    id: aet2q4fn8i8i********
    folder_id: aoerb349v3h4********
    created_at: "2021-03-03T19:07:08.685Z"
    name: production-zone
    zone: www.example.com.
    public_visibility: {}
    

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 relevant documentation on the Terraform website or its mirror.

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

  1. In the configuration file, describe 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  = true
    }
    

    Where:

    • name: Zone name. Note that the zone name must be unique within a 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 name. Note that it must end with a trailing dot. You cannot create top-level domain (TLD) zones. To create a domain name with non-Latin characters, use Punycode encoding. This is a required setting.
    • public: Zone visibility, public or private. This is an optional parameter.

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

  2. Create the resources:

    1. In the terminal, go to the directory where you edited the configuration file.

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

      terraform validate
      

      If the configuration is correct, you will get this message:

      Success! The configuration is valid.
      
    3. 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 any errors, Terraform will show them.

    4. Apply the changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

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

    yc dns zone get <zone_name>
    

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

To use domain names in the public DNS zone, you need to delegate it to authoritative name servers. Specify ns1.yandexcloud.net and ns2.yandexcloud.net server addresses in your registrar's account settings.

Was the article helpful?

Previous
Creating a private DNS zone
Next
Updating a DNS zone
© 2025 Direct Cursus Technology L.L.C.