Setting up Google Cloud DNS for a GoDaddy domain

This guide walks you through setting up Google Cloud DNS to serve requests for a domain name purchased via GoDaddy.

Why use Google Cloud DNS?

Using this service takes advantage of Google’s domain name system (DNS) infrastructure. Google Cloud DNS is production-quality, can handle high-volume DNS requests, has low latency, and is secure. It especially makes sense to adopt Google Cloud DNS if your site is built on the Google Cloud Platform.

Assumptions

Before we being, we will assume that:

  • You have a VM instance in the Google Compute Engine environment
  • You have a domain registered with GoDaddy

Create a static IP address for your VM instance

Follow these instructions to reserve a static IP address for your VM instance.

Note down the IP address that was reserved for you.

Navigate to the Google Cloud Platform Console page for your project. Using the left-hand menu, navigate to Networking > VPC network > External IP addresses

Click on + Reserve Static Address

Edit the settings:

  • Name: a name to describe this IP reservation (e.g. “webserver-primary-ip”)
  • IP version: IPv4 or IPv6 depending on your needs
  • Type: Regional if you want to use it for accessing a VM instance
  • Region: Select the same region as where your VM instance lives
  • *Attached to: Select the instance you wish to attach the static IP address to
  • Click on Reserve to save your settings

You will be taken back to the External IP addresses list page. Here you can see the new IP address that has been assigned to your instance.

This IP address can now be used in your DNS settings.

Google Cloud DNS – create a new DNS Zone

From the left-hand menu navigate to NETWORKING > Network services > Cloud DNS

Click on Create zone

Configure your DNS zone. We will assume we are setting a DNS zone for xyz.com

  • Zone name: needs to be a unique name and the format is up to you. I prefer using the format 
dns-zone-{{domain}} (e.g. dns-zone-xyz-com)
  • DNS name: The domain you are setting the DNS zone
(e.g. xyz.com)
  • DNSSEC: Off
  • Click on the Create button

You will now be taken to the page listing out all the records for this zone. By default it will have a NS and a SOA zone.

Now let’s create an A record for our domain pointing to the static IP address we created in the previous step.

Click on Add Record set

Enter your settings:

DNS Name: of the form .yourdomain.com. (note the leading and trailing dots)
Resource Record Type: A
TTL: 5
TTL Unit: minutes
IPv4 Address: the IP address you noted down from creating a static IP address
Click on the Create button

Repeat the above steps for any other records you wish to configure – e.g. MX records for mailservers or CNAME records for subdomains.

Now take note of the provided NS values for the next step. The values will look like this:

ns-cloud-c1.googledomains.com.
ns-cloud-c2.googledomains.com.
ns-cloud-c3.googledomains.com.
ns-cloud-c4.googledomains.com.

GoDaddy – point your domain’s nameserver to Google Cloud DNS

Log in to GoDaddy and go to your My Domains page.

Click on the three dots next to your domain and select Manage DNS

Scroll down to Nameservers

Click on the Change button

Choose your new nameserver type: Custom

Add the nameserver names that were listed in your NS record. Keep in mind:

  • Remove the . at the end of each nameserver address. GoDaddy does not like it.
  • There are fields for the first two entries. For additional entries, click on the Add Nameserver button.

Click on Save when done.

Leave a comment

Your email address will not be published. Required fields are marked *