Google Cloud DNS- Accessing a VM instance using Domain Name

What you will learn here about Google Cloud DNS

  • What is google cloud DNS
  • How to access VM instance using a domain name
  • How to access VM instance using a domain name – second way

If you want to know what is subdomain then please visit the following link

What is subdomain

What is google cloud DNS

Google Cloud DNS functionality allows a user to access your VM instance by using a domain name. Usually, whenever we create a VM instance on Google Cloud, one external IP gets assign to us. Generally, we use assigned External IP address to access google cloud instance. By using cloud DNS we can access google cloud VM instance by using a domain name. So here we will see how to access google cloud VM instance by using a domain name. In order to access your VM instance using a Domain name, you need a domain name and VM instance. If you don’t have a domain name and VM instance then please click on below links to buy a domain and Creating a VM instance.
1)Buy a domain name
2)Create VM instance n Google Cloud

How to access VM instance using a domain name

Please follow the following steps to know how to access google cloud vm instance using domain name.
Assuming you have a domain name and a VM instance on Google Cloud.
1)Open Your Google Cloud console.
2)Navigate to the following path which is shown below.
Navigation menu -> NETWORKING ->Network services -> Cloud DNS
Google cloud dns
3)Now click on CREATE ZONE which is shown below.
cloud dns
4)Please fill the following information
Zone Type: Public
Zone Name: Enter name for the zone
DNS Name: enter your DNS name i.e. Domain name without www.
DNSSEC: choose ON and then click on Create which is shown below.
access vm using DNS
5)Now click on the Created zone which is shown below.

6)Now click on ADD RECORD SET which is shown below.

7)Please fill the following information:
Resource Record Type: Choose A
IPv4 Address: Enter the external IP address of VM instance
click on create which is shown below.

8)Now again click on ADD RECORD SET which is shown below.

9)Please fill the following information:
DNS Name: ADD www
Resource Record Type: Choose CNAME
Canonical Name: Enter DNS name
click on create which is shown below.

10)Now Open your DNS manager which is shown below. In order to open your DNS manager please visit your DNS account. Here I have taken domain name from GoDaddy, so I have opened my DNS manager which is shown below.

11)Now click on DNS which is shown above image.
12)Now please modify Nameservers as shown below
1)Click on Change
2)Choose nameserver type as custom
3)Click on Add Nameserver to add nameservers
4)click on Save.

13)Now open any browser and enter your DNS name and hit enter.

How to access VM instance using a domain name – second way

This is another way to Google Cloud VM instance using a domain name.

1)I am assuming you have purchased the domain name and you have created a VM instance on Google Cloud.

2)Now please sign in to your domain name account. In my case, I have got domain name from GoDaddy so I have signed in to my GoDaddy account which is shown below.

3)Now please click on DNS in front of the respective domain name which is shown below.

4)Now we need to modify A record. So please click of Edit to modify the A record.

If your A record is pointing to another IP then you need to another A record with the subdomain. So please visit the following link to know how to add a subdomain.

What is subdomain
Google cloud dns using godaddy

5)Now please enter the external IP address of VM instance in the Points to the field and click on Save which is shown below.
Access google cloud vm using dns

6)Now please go to the browser and enter the domain name.

Make sure that any service or any server is running on port 80 so that you can any kind of response. If any server is not running on port 80 then you will see error This site can’t be reached
COMMON PROBLEMS or MISTAKES or DOUBTS

1)Why am I getting This site can’t be Reached error even following the above all steps successfully?
Because none of the server or services are running on port 80.

2)How can I run the server on Google Cloud?
Please click on below link to install the server on Google Cloud. If you are installing below server then please install it on Port 80. Because default apache tomcat server runs on port 8080.
Installing the server on Google Cloud

3)Why I am getting apache tomcat default page when I am accessing my instance using DNS?
Because I have installed apache tomcat server on port 80 of VM instance.

How to host a website on Google Cloud

How to host a website on Google Cloud

You may also like...

Leave a Reply