Google Cloud Cloud DNS

Setting up Google Cloud DNS for your domain

Disclosure: This post may contain affiliate links, which means we may receive a commission if you click a link and purchase something that we recommended.

Pinterest LinkedIn Tumblr

Domain Name System(DNS) is a distributed database which lets you store IP addresses and other data and looks them up by names.

In this tutorial we point our domain registerd in Google Domains to Google Cloud DNS

Get your Professional Google Cloud Architect certificate with this easy to learn course now.

Prerequisites

Commonly used DNS Records

  • A Record – IPv4 address, maps IP of the host with a domain.
  • AAAA Record – IPv6 address, mainly used in HTTP(S), SSL Proxy, and TCP Proxy Load balancing.
  • CNAME – Alias for one name to another (www.domain.com, points to domain.com)
  • MX – Manages where emails should be delivered.
  • TXT – Any text content, like domain owner verification text or something like that

Why use Google Cloud DNS?

  1. To have everything in one place for your project.
  2. Managed by Google and it’s fast, reliable and secure with low-latency.
  3. Uses Anycast (requests are rooted to nearest location).
  4. Low Pricing (0.2/month per zone).

How to point your domain to Google Cloud DNS?

Go to Network Services >> Cloud DNS in your GCP Console

Click Create Zone

Google Cloud DNS Zone

Choose Public for the Zone type.

Enter your desired name (recommended to use your domain name without extension .com or .co.au) for the Zone name

Enter your domain name for the DNS name. For example, domain.com.

Keep the Off setting selected for DNSSEC.

Click Create.

Create new A record

Once the DNS zone is created you will be provided with default four NS records and SOA records.

NS Records

Now you can create a new record to point your domain to your VM Instance’s external IP address.

  1. Click Add record set.
  2. Select Resource Record Type to “A”.
  3. IPv4 Address with the IP address of your instance that you have reserved earlier.
  4. Leave everything to default.
  5. Click create
Create A record

Create new CNAME record

  1. Enter DNS name “www”.
  2. Select Resource Record Type to “CNAME”.
  3. Canonical name as your domain name followed by a period (domain.com.).
  4. Leave everything to default.
  5. Click create
Create CNAME record

Update your domain name servers

Login to your domain registrar (for example Google Domains) and go to DNS settings.

Select Use custom name servers.

Add the four NS records provided to you when you created the zone for your domain.

Update Nameservers

Save your settings.

Now your domain name is pointed to Google Cloud VM Instance and uses Google Cloud DNS.

Learn how to setup DNSSEC in Cloud DNS.

9 Comments

  1. NAVEEN GARG Reply

    I tried the above method. It is not working. It shows refuses to connect.

    • This setup will work without any issues, once you update the DNS the propagation will take 24 – 48 hrs. So you need to wait until propagation is completed or use a VPN or proxy to view the changes immediately

  2. Should the last screenshot have said e1-e4 instead of c1-c4 given that the name servers in your first screenshot were e1-e4?

    • Hi, thanks for pointing out. I have replaced the image with the correct one. You should use the nameservers that is created in the Cloud DNS

  3. Nickie Oakwood Reply

    My issue is this. When I create VM then install WP, I then set up SSL through SSH. all of this works but can’t change default wp url from http: to https. I have set up GCS with Load Balancer which combats this but what I want is to be ablt to create a WP Deployment but have it assigned to https then all good. How do I create this wP site based on the https?

    Many thanks

  4. DEBASIS HALDER Reply

    Hi there,
    It’s a good effort and through this process I proceeded but may be due to some intermediate problem I could not connect my domain[wdloo.com] to google cloud dns. If you permit me to send you what I AM FACING now through your email[by showing screenshot] may be you would be able to understand the problem. Then by your suggestion I MAY PROCEED .

    TIA

  5. Once I added the Google Cloud DNS I lost the email alias forwarding from my google domain. It says “To enable them, restore the default Google Domains name servers.” Any help?

Write A Comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.