This page explains how to set up a managed zone and a resource record for your domain name. It walks through a simple example of creating a managed zone, and then setting up Address (A) and Canonical Name (CNAME) records for the domain.
This quickstart assumes you have a domain name and an IP address that you can point the domain name to. If you do not, you can register a domain name through Google Domains or another domain registrar of your choice.
Before you begin
Sign in to your Google account.
If you don't already have one, sign up for a new account.
- Select or create a Cloud Platform project.
- Enable billing for your project.
- Enable the DNS API.
- Have a domain name through a domain name registrar, like Google Domains.
- Have an IP address to point the A record of your zone. A valid IP address can be:
- A server you already have running with an IP address you can point to.
- A Wordpress site that you can launch on Google Compute Engine. After launching the website, you can get the IP address of the virtual machine instance in the Google Cloud Platform Console.
- The IP address of your local machine. Use this option only to test
the resolution of the domain name.
Look up your IP.
Caution: Do not set your domain name to permanently point to your local machine.
Create a managed zone and a record
A managed zone is a container for DNS records of the same DNS name suffix. A managed zone has a set of name servers that accept and responds to queries. Create a new managed zone:
Go to the Create a DNS zone page in the Cloud Platform Console.
my-new-zonefor the ZONE NAME.
- Enter a DNS NAME prefix for the zone using a domain name that you own.
- Click Create.
On the zone listing page, click the zone name to get to the records page. Default NS and SOA records have already been created for you.
Create a new record
A record to point the domain to the external IP address. If
your IP address is in the form
#.#.#.#, you have an IPv4 address and need to
If your IP address is in the format
#:#:#:#:#:#:#:#, you have an IPv6
address and should create an
AAAA record to point the domain to the IP
- Click Add record set.
- If you have an IPv4 address, select
Afrom the Resource Record Type menu. If you have an IPv6 address, select
- Under IPv4 Address or IPv6 Address section, enter the IP address you want to use with this domain.
- Click Create.
Next, create a CNAME record for the
- Click Add record set while in the Cloud Platform Console.
- Under DNS Name, enter
- Under Resource Record Type, choose
- Under Canonical name, enter the domain name, followed by a period. For
- Click Create.
The record update will take some time to propagate depending on the time-to-live (TTL) values in your zone. You can verify that the DNS records are working by visiting the domain name and confirming that the domain resolves to your IP address.
Update your domain name servers
Finally, you must update your domain's name servers to use Cloud DNS to publish your newly-created records to the Internet.
Even if your domain name is registered with Google Domains, you still need to update the name servers — although they look very similar, the name servers used by Google Domains are not the same as those used by Cloud DNS for your managed zone.
That's it, you successfully set up your DNS records using Google Cloud DNS!
To avoid incurring charges to your Google Cloud Platform account for the resources used in this quickstart:
Go to the Cloud DNS Zones page in Cloud Platform Console.
Click on the trash can icon next to
my-new-zoneto delete the zone.