Google Cloud DNS- Accessing a VM instance using Domain Name

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

Steps for Cloud DNS

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

3)Now click on CREATE ZONE which is shown below.

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.

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.

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.

You may also like...

Leave a Reply