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
- Have a Compute Engine Instance running
- Reserved the External IP address of your VM Instance.
- For setting up Compute Engine, see the Setting up Compute Engine Instance
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?
- To have everything in one place for your project.
- Managed by Google and it’s fast, reliable and secure with low-latency.
- Uses Anycast (requests are rooted to nearest location).
- 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

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.

Now you can create a new record to point your domain to your VM Instance’s external IP address.
- Click Add record set.
- Select Resource Record Type to “A”.
- IPv4 Address with the IP address of your instance that you have reserved earlier.
- Leave everything to default.
- Click create

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

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.

Save your settings.
Now your domain name is pointed to Google Cloud VM Instance and uses Google Cloud DNS.
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?
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
SORRY DOMAIN NAME WOULD BE
wdlaoo.com
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
While using LoadBalancer you need to follow a different approach for setting up as described here.
https://www.cloudbooklet.com/setup-https-load-balancing-in-google-cloud-cdn/
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
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