Quickstart

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

For more information, see the following resources:

  • For Cloud DNS concepts, see the Cloud DNS overview.
  • For terminology related to Cloud DNS, see Key terms.
  • For Virtual Private Cloud (VPC) network configuration information, see the VPC overview.
  • For configuration how-tos and API information, see What's next.

Requirements

This quickstart assumes that you have the following:

  • A domain name through a domain name registrar. You can register a domain name through Google Domains, Cloud Domains, or another domain registrar of your choice. Cloud Domains lets you manage domains through an API, while Google Domains does not allow API access.
  • An IP address to which to point the A record of your zone. A valid IP address can be a server that you already have running with an IP address that you can point to. For example, you can go through this tutorial to start up a web server on a Compute Engine VM.

Before you begin

  1. Sign in to your Google Account.

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

  2. In the Google Cloud Console, on the project selector page, select or create a Google Cloud project.

    Go to the project selector page

  3. Zorg dat facturering is ingeschakeld voor uw project.

    Meer informatie over het inschakelen van facturering

  4. Enable the DNS API.

    Enable the API

Create a managed public zone

  1. In the Google Cloud Console, go to the Create a DNS zone page.

    Go to Create a DNS zone

  2. For the Zone type, select Public.

  3. For the Zone name, enter my-new-zone.

  4. For the DNS name, enter a DNS name suffix for the zone by using a domain name that you registered (for example, example.com).

  5. Under DNSSEC, ensure that the Off setting is selected.

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

  6. Click Create.

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

Screenshot of the Zone details page.

To edit a record, on the Zone details page, at the end of the row for the record that you want to edit, click Edit.

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

If your IP address is in the format #.#.#.#, 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. In the Cloud Console, go to the Cloud DNS page.

    Go to Cloud DNS

  2. Click the zone where you want to add a record set.

  3. Click Add record set.

  4. Under Resource Record Type, to create an A record, select A. To create an AAAA record, select AAAA.

  5. Under IPv4 Address or IPv6 Address, enter the IP address that you want to use with this domain.

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

  6. Click Create.

Create a CNAME record for the www subdomain

  1. In the Cloud Console, go to the Cloud DNS page.

    Go to Cloud DNS

  2. Click the zone where you want to add a record set.

  3. Click Add record set.

  4. Under DNS Name, enter www.

  5. Under Resource Record Type, select CNAME.

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

  7. Click Create.

The record update takes some time to propagate depending on the time-to-live (TTL) values of the records. 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 new 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 similar, the name servers used by Google Domains are not the same as the name servers used by Cloud DNS for your managed zone.

You have successfully used Cloud DNS to set up your DNS records.

Clean up

To avoid incurring charges to your Google Cloud account for the resources used in this quickstart, follow these steps.

  1. In the Cloud Console, go to the Cloud DNS zones page.

    Go to Cloud DNS zones

  2. 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 record sets.

    Screenshot of the Zone details page.

  5. Go to the Cloud DNS zones page.

    Go to Cloud DNS zones

  6. To delete the zone, select the my-new-zone check box, and then at the end of the row, click Delete zone.

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

What's next