Create, modify, and delete zones Stay organized with collections Save and categorize content based on your preferences.
This page provides directions for creating, updating, listing, and deletingCloud DNS managed zones. Before you use this page, familiarize yourself withtheCloud DNS overview andKey terms.
Permissions required for this task
To perform this task, you must have been granted the following permissionsor the following IAM roles.
Permissions
dns.managedZones.createto create a managed zonedns.managedZones.listto list managed zonesdns.networks.bindPrivateDNSZonedns.networks.targetWithPeeringZonedns.gkeClusters.bindPrivateDNSZonedns.managedZones.updatedns.managedZones.listdns.managedZones.patchdns.activePeeringZones.getZoneInfodns.activePeeringZones.listdns.activePeeringZones.deactivate
Roles
roles/dns.adminroles/dns.peer
Before you begin
The Cloud DNS API requires that you create a Cloud DNS project andenable the Cloud DNS API.
If you are creating an application that uses the REST API, you must alsocreate an OAuth 2.0 client ID.
- If you don't already have one,sign up for a Google Account.
- Enable the Cloud DNS API in the Google Cloud console. You can choose an existing Compute Engine or App Engine project, or you can create a new project.
- If you need to make requests to the REST API, you need to create an OAuth 2.0 ID. SeeSetting up OAuth 2.0.
- In the project, note the following information that you need to input in later steps:
- The client ID (
xxxxxx.apps.googleusercontent.com). - The project ID that you want to use. You can find the ID at the top of theOverview page in the Google Cloud console. You can also ask your user to provide the project name that they want to use in your app.
- The client ID (
If you have not run the Google Cloud CLI previously, you mustrun the following command to specify the project name and authenticate withthe Google Cloud console:
gcloud auth login
If you want to run agcloud command on Google Cloud resourcesin another project, specify the--project option for this command and for theothergcloud commands throughout this page.
Create managed zones
Each managed zone that you create is associated with aGoogle Cloud project.The following sections describe how to create the type of managed zone thatCloud DNS supports.
Create a public zone
To create a new managed zone, complete the following steps.
Console
In the Google Cloud console, go to theCreate a DNS zone page.
For theZone type, selectPublic.
Enter aZone name such as
my-new-zone.Enter aDNS name suffix for the zone using a domain name that youown. All records in the zone share this suffix, for example:
example.com.UnderDNSSEC, selectOff,On, orTransfer. For moreinformation, seeEnable DNSSEC for existing managed zones.
ClickCreate. TheZone details page is displayed.
gcloud
Run thedns managed-zones createcommand:
gcloud dns managed-zones createNAME \ --description=DESCRIPTION \ --dns-name=DNS_SUFFIX \ --labels=LABELS \ --visibility=public
Replace the following:
NAME: a name for your zoneDESCRIPTION: a description for your zoneDNS_SUFFIX: the DNS suffix for your zone, such asexample.comLABELS: an optional comma-delimited list of key-valuepairs such asdept=marketingorproject=project1; for moreinformation, see theSDK documentation
Terraform
resource "google_dns_managed_zone" "example_zone" { name = "example-zone" dns_name = "example-${random_id.rnd.hex}.com." description = "Example DNS zone" labels = { name = "value" }}resource "random_id" "rnd" { byte_length = 4}API
Send aPOST request using themanagedZones.createmethod:
POST https://dns.googleapis.com/dns/v1/projects/PROJECT_ID/managedZones{ "name": "NAME", "description": "DESCRIPTION", "dnsName": "DNS_NAME", "visibility": "public"}Replace the following:
PROJECT_ID: the ID of the project where the managedzone is createdNAME: a name for your zoneDESCRIPTION: a description for your zoneDNS_NAME: the DNS suffix for your zone, such asexample.com
NS andSOA records for youautomatically when you create the zone. Do not change the name of your zone'sNS record, and do not change the list of name servers thatCloud DNS selects for your zone.Create a private zone
To create a new managed private zone with private DNS records managed byCloud DNS, complete the following steps. For more information,seeBest practices for Cloud DNS privatezones.
Console
In the Google Cloud console, go to theCreate a DNS zone page.
For theZone type, selectPrivate.
Enter aZone name such as
my-new-zone.Enter aDNS name suffix for the private zone. All records in thezone share this suffix, for example:
example.private.Optional: Add a description.
UnderOptions, selectDefault (private).
Select the Virtual Private Cloud (VPC) networks to which the private zonemust be visible. Only the VPC networks that you select areauthorized to query records in the zone.
ClickCreate.
gcloud
Run thedns managed-zones createcommand:
gcloud dns managed-zones createNAME \ --description=DESCRIPTION \ --dns-name=DNS_SUFFIX \ --networks=VPC_NETWORK_LIST \ --labels=LABELS \ --visibility=private
Replace the following:
NAME: a name for your zoneDESCRIPTION: a description for your zoneDNS_SUFFIX: the DNS suffix for your zone, such asexample.privateVPC_NETWORK_LIST: a comma-delimited list ofVPC networks that are authorized to query the zoneLABELS: an optional comma-delimited list of key-valuepairs such asdept=marketingorproject=project1; for moreinformation, see theSDK documentation
Terraform
resource "google_dns_managed_zone" "private_zone" { name = "private-zone" dns_name = "private.example.com." description = "Example private DNS zone" labels = { foo = "bar" } visibility = "private" private_visibility_config { networks { network_url = google_compute_network.network_1.id } networks { network_url = google_compute_network.network_2.id } }}resource "google_compute_network" "network_1" { name = "network-1" auto_create_subnetworks = false}resource "google_compute_network" "network_2" { name = "network-2" auto_create_subnetworks = false}API
Send aPOST request using themanagedZones.create method:
POST https://dns.googleapis.com/dns/v1/projects/PROJECT_ID/managedZones{ "name": "NAME", "description": "DESCRIPTION", "dnsName": "DNS_NAME", "visibility": "private", "privateVisibilityConfig": { "kind": "dns#managedZonePrivateVisibilityConfig", "networks": [ { "kind": "dns#managedZonePrivateVisibilityConfigNetwork", "networkUrl": "VPC_NETWORK_1" }, { "kind": "dns#managedZonePrivateVisibilityConfigNetwork", "networkUrl": "VPC_NETWORK_2" }, .... ] }}Replace the following:
PROJECT_ID: the ID of the project where the managed zone iscreatedNAME: a name for your zoneDESCRIPTION: a description for your zoneDNS_NAME: the DNS suffix for your zone, such asexample.privateVPC_NETWORK_1andVPC_NETWORK_2:URLs for VPC networks in the same project that can queryrecords in this zone. You can add multiple VPC networksas indicated. To determine the URL for a VPC network,use the followinggcloudcommand, replacingVPC_NETWORK_NAMEwith the network's name:gcloud compute networks describeVPC_NETWORK_NAME \ --format="get(selfLink)"
Create a zone with specific IAM permissions
The Identity and Access Management (IAM) permission for individual resource managed zonelets you set up specific read, write, or administrator permissions fordifferent managed zones under the same project.
For instructions about how to create a zone with specific Identity and Access Management (IAM)permissions, seeCreate a zone with specific IAMpermissions.
Create a Service Directory DNS zone
You can create a Service Directory zone that allows your Google Cloud-basedservices to query your Service Directory namespace through DNS.
For detailed instructions about how to create a Service Directory DNS zone, seeConfiguring a Service Directory DNS zone.
For instructions about how to use DNS to query your Service Directory, seeQuerying using DNS.
Note: You cannot add records to a Service Directory DNS zone directly;the data comes from the Service Directory service registry.Terraform
resource "google_dns_managed_zone" "private_zone" { name = "private-zone" dns_name = "private.example.com." description = "Example private DNS zone" labels = { foo = "bar" } visibility = "private" private_visibility_config { networks { network_url = google_compute_network.network_1.id } networks { network_url = google_compute_network.network_2.id } }}resource "google_compute_network" "network_1" { name = "network-1" auto_create_subnetworks = false}resource "google_compute_network" "network_2" { name = "network-2" auto_create_subnetworks = false}Create a managed reverse lookup private zone
A managed reverse lookup zone is a private zone with a special attribute thatinstructs Cloud DNS to perform a PTR lookup against Compute EngineDNS data. You must set up managed reverse lookup zones for Cloud DNSto correctly resolve non-RFC 1918 PTR records for your virtual machine (VM)instances.
For instructions on how to create a new managed reverselookup private zone, seeCreate a managed reverse lookupzone.
Create a forwarding zone
Forwarding zones let you target name servers for specific private zones. Forinstructions on how to create a new managed privateforwarding zone, seeCreate a forwardingzone.
Create a peering zone
DNS peering lets you send requests for records that come from one zone'snamespace to another VPC network. For instructions onhow to create a peering zone, seeCreate a peeringzone.
Create a cross-project binding zone
Create a managed private zone that can be bound to a network that is owned by adifferent project within the same organization. For instructions on how tocreate a cross-project binding zone, seeCross-project bindingzones.
Update managed zones
Cloud DNS lets you modify certain attributes of your managedpublic or managed private zone.
Update public zones
You can change the description orDNSSEC configuration of a public zone.
Console
In the Google Cloud console, go to theCloud DNS zones page.
Click the public zone that you want to update.
ClickEdit.
To change DNSSEC settings, underDNSSEC, selectOff,On, orTransfer. For more information, seeEnabling DNSSEC for existing managed zones.
Note: Before you disable DNSSEC for a managed zone that you still wantto use, you must deactivate DNSSEC for your zone at your domain registrarto ensure that DNSSEC-validating resolvers can still resolve names in thezone. For details, seeDisabling DNSSEC for managed zones.Optional: Update the description.
ClickSave.
gcloud
Run thedns managed-zones updatecommand:
gcloud dns managed-zones updateNAME \ --description=DESCRIPTION \ --dnssec-state=STATE
Replace the following:
NAME: a name for your zoneDESCRIPTION: a description for your zoneSTATE: a DNSSEC setting such asOff,On,orTransfer
Update private zones
You can modify the VPC networks to which a private zone is visible.
Console
In the Google Cloud console, go to theCloud DNS zones page.
Click the private zone that you want to update.
ClickEdit.
Select the VPC networks to which the private zone must bevisible. Only the selected VPC networks are authorizedto query records in the zone.
ClickSave.
gcloud
Run thedns managed-zones updatecommand:
gcloud dns managed-zones updateNAME \ --description=DESCRIPTION \ --networks=VPC_NETWORK_LIST
Replace the following:
NAME: a name for your zoneDESCRIPTION: a description for your zoneVPC_NETWORK_LIST: a comma-delimited list ofVPC networks that are authorized to query the zone
Update labels
To add new, change existing, remove selected, or clear all labels on a managedzone, complete the following steps.
gcloud
Run thedns managed-zones updatecommand:
gcloud dns managed-zones updateNAME \ --update-labels=LABELS
gcloud dns managed-zones updateNAME \ --remove-labels=LABELS
gcloud dns managed-zones updateNAME \ --clear-labels
Replace the following:
NAME: a name for your zoneLABELS: an optional comma-delimited list of key-valuepairs such asdept=marketingorproject=project1; for moreinformation, see theSDK documentation
List and describe managed zones
The following sections show how to list or describe a managed zone.
List managed zones
To list all of your managed zones within a project, complete the following steps.
Console
In the Google Cloud console, go to theCloud DNS zones page.
View managed zones in the right pane.
gcloud
Run thedns managed-zones listcommand:
gcloud dns managed-zones list
To list all managed zones, modify the command as follows:
gcloud dns managed-zones list
--filter="visibility=public"
gcloud dns managed-zones list \ --filter="visibility=private"
Describe a managed zone
To view the attributes of a managed zone, complete the following steps.
Console
In the Google Cloud console, go to theCloud DNS zones page.
Click the zone that you want to inspect.
gcloud
Run thedns managed-zones describecommand:
gcloud dns managed-zones describeNAME
ReplaceNAME with the name of your zone.
Delete a managed zone
When you delete a zone, its DNS records are permanently removed;they cannot be recovered. To prevent losing your DNS records, export yourzone data before deletion. For information about how to export zone data,seeImport and export resource record sets.
To delete a managed zone, complete the following steps.
Console
In the Google Cloud console, go to theCloud DNS zones page.
Click the managed zone that you want to delete.
ClickDelete zone.
gcloud
Remove all records in the zone except for the
SOAandNSrecords.For more information, seeRemoving a record.You can quickly empty an entire zone by importing an empty file into arecord set. For more information, seeImporting and exporting recordsets.For example:touch empty-filegcloud dns record-sets import -zNAME \ --delete-all-existing \ empty-filerm empty-file
Replace
NAMEwith the name of your zone.To delete a new managed private zone, run the
dns managed-zonesdeletecommand:gcloud dns managed-zones deleteNAME
Replace
NAMEwith the name of your zone.
What's next
- To find solutions for common issues that you might encounter when usingCloud DNS, seeTroubleshooting.
- To configure Cloud DNS server policies and use them withVPC networks, seeApply Cloud DNS server policies.
- To use IDNs with Cloud DNS, seeCreate zones with internationalized domain names.
- To display an audit log of operations, seeView operations on managed zones.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.