Quickstart

This page explains how to set up a Google Cloud DNS 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.

Requirements

This quickstart assumes you have:

  • A domain name through a domain name registrar. You can register a domain name through Google Domains or another domain registrar of your choice.
  • 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.
    • An Apache webserver that you can launch on Google Compute Engine.

Before you begin

  1. Sign in to your Google Account.

    If you don't already have one, sign up for a new account.

  2. Select or create a GCP project.

    Go to the Manage resources page

  3. Make sure that billing is enabled for your project.

    Learn how to enable billing

  4. Enable the DNS API.

    Enable the API

Create a managed zone

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:

  1. Go to the Create a DNS zone page in the GCP Console.

    Go to the Create a DNS zone page

  2. Enter my-new-zone for the ZONE NAME.

  3. Enter a DNS NAME suffix for the zone using a domain name that you own. For example, example.com.

  4. Under DNSSEC, keep the Off setting selected.

    Screenshot of the Create a DNS Zone page in the GCP Console.

  5. Click Create.

The Zone details page is displayed. Note that default NS and SOA records have been created for you.

Screenshot of the Zone details page.

Create a new record

Create a new record to point the domain to an external IP address.

If your IP address is in the form #.#.#.#, you have an IPv4 address and need to create an A record. If your IP address is in the format #:#:#:#:#:#:#:#, you have an IPv6 address and need to create an AAAA record.

  1. Click Add record set.
  2. To create an A record, select A from the Resource Record Type menu. To create an AAAA record, select AAAA.
  3. Under IPv4 Address or IPv6 Address section, enter the IP address you want to use with this domain.

    Screenshot of the Create record set page showing an A record type with an IP address.

  4. Click Create.

Create a CNAME record

Next, create a CNAME record for the www subdomain:

  1. Click Add record set.
  2. Under DNS Name, enter www.
  3. Under Resource Record Type, choose CNAME.
  4. Under Canonical name, enter the domain name, followed by a period. For example, example.com..

    Screenshot of the Create a record set page showing a CNAME record type with a canonical name.

  5. 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.

Clean up

To avoid incurring charges to your Google Cloud Platform account for the resources used in this quickstart:

  1. Go to the Cloud DNS Zones page in GCP Console.

    Go the DNS Zones page

  2. On the Cloud DNS Zones page, click the zone name (my-new-zone) to get to the Zone details page.

  3. Select the A and CNAME records that you created.
  4. Click Delete Records Sets.

    Screenshot of the Zone details page.

  5. Go to the Cloud DNS Zones page in GCP Console.

    Go the DNS Zones page

  6. Click the trash can icon next to the zone name (my-new-zone) to delete the zone.

    Screenshot of the Cloud DNS zones page highlighting a trash can icon on the right of a zone entry.

What's next

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud DNS Documentation