Last updated on August 17th, 2019
Do you want to Transfer Domain Name for hosted WordPress website on Google Cloud Hosting?
You will have a domain name that you would like to Transfer Domain Name to Google Cloud Hosting.
In this article, we will tell you how to set your purchased domain name in Google Cloud Hosting so that your domain name is displayed instead of your website number (IP Address).
Whenever someone opens your website, it looks like http://www.yourdomain.com
Transfer Domain Name in other hosting providers is very easy, But Transfer Domain Name in the Google Cloud Platform is a bit difficult.
But do not worry, we will explain to you how to Transfer Domain Name to Google Cloud Hosting.
Before starting this tutorial, you must have a domain name. If you do not have a domain name, then you have to buy it first.
You will find a whole lot of domain providers in the market. Most people like to take .com domains but you can take domains according to your choice.
To register a domain name:
Visit a domain name provider’s website (We recommend GoDaddy). And purchase the domain name as per your requirement.
So let’s start!
Enable Cloud DNS API
Sign in to the Google Cloud Platform account. Go to the hamburger menu located in the left corner of the screen and click on the Marketplace.
Now Search “Enable Cloud DNS API” in the search box and click on the showed result of “Enable Cloud DNS API”
If your DNS API is enabled then “API Enabled” appears, if not, then click on the “Enable” button.
Reserve a static IP address on Google Cloud Console.
Now you need to configure Static IP address for your WordPress website.
A static IP address is not automatically set in the Google Cloud. That’s why it’s important for your website to set it up.
Due to not set up a Static IP, most people in the Google Cloud Platform have to face many problems.
If you do not set static IP when you turn off and start the server in your compute engine (CE), Google Cloud automatically gives a new static IP to your server, due to this, your website’s DNS configuration Damages them. And your website gets down.
For this to not happen with your website, we will guide you on setting up your website’s static IP address on the Google Cloud Platform.
From the hamburger menu in the Google Cloud Dashboard, scroll down to “VPC Network” and click on “External IP Address”
In the “Type” you will see an Ephemeral, you can select “STATIC“.
Create Cloud DNS zone
You have set up static IP successfully, now you have to set up cloud DNS. Scroll to “Network Services” on the sidebar and click on “Cloud DNS”.
You have to create a zone here. Click “Create Zone“.
Here you select the “Zone Type” public. Write your domain name in the zone name. Type your domain name in the DNS name (Ex: yourdomain.com). Let DNSSEC stay off. If you want to write something about your domain name in the description you can write. And click the Create button.
In the resource record type, select “A”. In the IPv4 address field, enter your IPv4 address. The next image will help you find your IPv4 address.
To find the IPv4 address, click the hamburger menu in the upper left corner of your dashboard and go to Compute Engine> VM Instance>. Here you will see an IP in the external IP Write the same IPv4 address. And then click the Create button.
You made A record successfully, now we will create a CNAME record.
Here you can click on ADD RECORD SET. In the DNS name, type “WWW” next to your website name. Select “CNAME” in the resource record type. Type your domain name (ex: yourdomain.com) in the Canonical name and click the Save button.
Update your Domain Name Server (DNS)
You have successfully created both of the DNS records. So now we need to update your domain nameservers.
Log in to your domain account where you purchased your domain name.
If you have registered your domain with Godaddy, here you will see the upside “DNS” in it click on MANAGE ZONES.
Then here you go to 3 DOT and click on MANAGE DNS.
Now you will see a new dashboard, you have to add the nameserver here, but before that, you have to go to your Google Cloud DNS zone.
In the Google Cloud DNS zone, you will see 4 nameservers updated to your domain name server one by one. And then click on Save.
Congratulation! You have successfully added your domain to your Google Cloud Console for your website.
Now you can see your website by typing your domain into a web browser.
If you are not getting your website open in a web browser then do not worry.
Any changes made in your domain nameserver (DNS) are not immediately reflected, it takes a little time. Well, the nameserver is updated within 1 hrs, but in some case, it may take up to 24 hours.
So just wait a bit and try again by typing the name of your site in the web browser again. If you have followed all of our instructions correctly you will be able to browse your website.
If you have any questions, please tell us in the comments.