Setting up Google Cloud DNS for a GoDaddy domain

Google Cloud Platform menu Networking Cloud DNS

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.

Google Cloud DNS – create a new DNS Zone

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

 

Click on Create zone
Google Cloud Platform Cloud DNS 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 for (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
Google Cloud Platform Cloud DNS 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

 

Google Cloud Platform Cloud DNS create record set

 

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:

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
GoDaddy Mange 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.

Testing

Let’s test whether everything worked. So far we have:

  • Created a static IP address in the Google Cloud Platform
  • Created a DNS Zone in the Google Cloud Platform
  • Created an A record pointing to the static IP address we created
  • Configured our domain’s DNS settings in GoDaddy to point to Google’s nameservers

Open up a terminal on your machine.
Type in nslookup yourdomain.com. If everything is OK, you’ll see something like the below. Ensure that the Non-authoritative answer > Address value corresponds with the static IP that you created.

$ nslookup measurementcookbook.com
Server: 8.8.8.8
Address: 8.8.8.8#53

Non-authoritative answer:
Name: measurementcookbook.com
Address: 104.199.123.101

If you don’t see this in your terminal, wait 2 minutes and try again. It can take some time for the changes on GoDaddy to propagate through to Google.

If you’re still not seeing the right results, retrace your steps above and ensuring that:

  • You are using the correct static IP address in your A record
  • You entered the correct nameserver addresses into GoDaddy’s nameserver settings for your domain

 

Resources

Did you find this helpful and think it would be beneficial for someone else? Share now!

Leave a Reply

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