Dipraj Patra

Creating scheduled snapshots (with screenshots) | Google Cloud

To ensure your Google Cloud VM Instance data’s safety, you should snapshots (backup) your VM regularly. Early this year (2019) Google Cloud Announced a feature which can automate your snapshots, it’s called Snapshots schedule.

So, In this tutorial, you will  learn how to create a Snapshots schedule for persistent disk.

As you know that Snapshots are incremental on Google cloud Platform. It means, Only the first snapshot will contain all the data on the persistent disk. If you create a second snapshot that snapshot only contains any new data or modified data since the first snapshot. And Snapshot 3 contains any new or changed data since snapshot 2.

When you delete a snapshot, Compute Engine immediately marks the snapshot as DELETED in the system. If that snapshot has no dependent snapshots, then it deleted outright. But if it has dependent snapshots then the data automatically get transfer to the next one.

How much it cost to set up schedule snapshots on GCP? There is no extra cost for creating a snapshot schedule on GCP. But you have to pay for the snapshot which is (in most situations)  $0.026-$0.035 per GB/month. 

I am also using schedules snapshot to back up my website. My website’s VM server is located in the USA (us-east1-b) and currently it has 3.30 GB of data, So I am paying around  (3.30×0.026) $0.0858 per month.

When we set up snapshot schedule on a Persistent disk Google Cloud create snapshot automatically on an hourly, daily, weekly basis. Just like we discuss earlier, Only the first snapshot will contain all the data and second snapshot that snapshot only contains any new data or modified data since the first snapshot.

So, here are steps to create Snapshots Schedule,

Step 1: Creating a Snapshot Schedule

1. Log in to your Google Cloud account. On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

2. After that, Navigate to Compute Engine >> Snapshots.

3. Then click on “Create snapshot” button.

Step 2: Configuring Snapshot Schedule

4. Name: It is your  snapshot name. Give any name as you wise.

5. Region: select where you want to set up your snapshot schedule. Note: It is not the snapshot location, rather it is your schedule location. 

Go to your VM instance or Disk page and check the zone details. As you can see that on the above image that I set up my VM in us-east1.

I select us-east1 Because my VM’s  location is us-east1, I want this schedule to be available in that location. 

6. Snapshot location : select where you want to store your VM snapshot (backup). Choose default if you don’t want to pay any network fees. 

Schedule frequency – choose how often you want to take a backup from daily, weekly, hourly. Start time – at what time backup should be made. Here is link for GMT time converter.

7. Autodelete snapshots after – how many last snapshots you want to keep at any time. 

8. Deletion rule – (very important) what should happen if you delete your VM instance(source disk). If you choose Keep snapshots: then your backups are retained permanently unless you delete them manually. If you choose “Delete snapshots older than * days then your backup get automatically deleted after * days. 

9.  If you are using Windows, you can Enable VSS

10.  Finally, Click Create to create the snapshot schedule.

Step 3: Attaching snapshot schedule to a disk

Once you have created a snapshot schedule, you need to attach it to your source or VM boot disk to generate automatic snapshots.  

11. Navigate to Compute Engine >> Disks.

12. Now click over the name of your VM instance or Source disk.

13. After that, from your right-hand top conner, click on “EDIT” to modify your disks settings.

14. Now, Scroll down to “Snapshot schedule”  and choose your newly created Snapshot schedule.

15. Finally, click Save to apply the schedule on your persistent disk.

Now it is your time!

I tried my best to provide you a complete tutorial on how you can create and set up a snapshot schedule on Google Cloud Platform. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks

Automatically Backup Google Cloud VM (with screenshots)

To ensure your Google Cloud VM Instance data’s safety, you should backup your VM regularly. In this tutorial you will learn to create back up of your Google Cloud VM Instances. 

How to back up Google Cloud VM instances?

On Google Cloud Platform The backup procedure is slightly different. To take back up of Your VM you will be creating persistent disk snapshots. Though there is another way, by creating Image of your whole instance you also can create backups. But that said, it is not a recommand way of taking backups because Images are primarily used to create boot disks for instances or to configure the boot disks for instance templates. 

Snapshots are incremental and automatically compressed, so you can create regular snapshots on a persistent disk faster and at a much lower cost than if you regularly created a full image of the disk. — Google Cloud.

How to automatically back up Google Cloud VM instances?

Recently Google introduced a new snapshot feature which is called “Snapshot schedules”, With Snapshot schedules you can create automatic backups for your VM instances.

How much it cost to back up Google Cloud VM instances?

Though the back up cost might also incur network fees based on the storage location of the snapshot but in most situations the cost is between $0.026-$0.035 per GB/month. 

I am also using schedules snapshot to back up my website. My website’s VM server is located in the USA (us-east1-b) and currently it has 3.30 GB of data, So I am paying around  (3.30×0.026) $0.0858 per month.

Explanation:

Before we start our tutorial let me explain the process.

Snapshots are incremental on GCP. It means, Only the first snapshot will contain all the data on the persistent disk. If you create a second snapshot that snapshot only contains any new data or modified data since the first snapshot. And Snapshot 3 contains any new or changed data since snapshot 2.

 If a snapshot has no dependent snapshots, then you can delete it outright. But if it has dependent snapshots then the data automatically get transfer to the next one.

So, Let’s get started,

Setting up Automatic backups

1. Log in to your Google Cloud account. On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

2. After that, Navigate to Compute Engine >> Disks.

3. Now click over the name of your VM instance.

4. After that, from your right-hand top conner, click on “EDIT” to modify your disks settings.

5. Now, Scroll down to “Snapshot schedule”  and choose “Create schedule”.

6. Creating a new Snapshot Schedule,

  1. Name: It is your snapshot schedule name. Give any name as you wise.
  2. Leave it as default. If you don’t know about Region and Snapshot location then don’t change anything, it may incur network fees. 
  3. Schedule frequency – choose how often you want to take a backup from daily, weekly, hourly. Start time – at what time backup should be made. Here is link for GMT time converter.
  4. Autodelete snapshots after – how many last snapshots you want to keep at any time. Deletion rule – (very important) what should happen if you delete your VM instance(source disk). If you choose Keep snapshots: then your backups are retained permanently unless you delete them manually. If you choose “Delete snapshots older than * days then your backup get automatically deleted after * days. 

After that click on the Create button to save your new backup schedule.

Finally, click the save button to apply the changes.

Setting up Manual backups

1. On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

2. After that, Navigate to Compute Engine >> Snapshots.

3. Then click on “Create snapshot” button.

4. Name: It is your backup (snapshot) name. Give any name as you wise.

5. After that, Scroll down to “Source disk” and choose your VM Instance (boot disk) from the list.

6. Leave Location as default. If you don’t know about Region and Snapshot location then don’t change anything, it may incur network fees. 

7. Finally, click on “Create” to generate a backup of your VM.

Here I created two backups (snapshots) of my usa-main-server. The first one contain a full backup of my server but the second only contains any new data or modified data since the first backup.

Now it is your time!

I tried my best to provide you a complete tutorial on how you can create backups of your VM instance on Google Cloud Platform. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks

Installing cPanel & WHM on Google Cloud

Installing cPanel & WHM on your Google Cloud Instance could overwhelm you if you are not familiar with the installation & configuration process.

That is why In this tutorial I will help to install cPanel and WHM on your Google Compute Engine’s VM Instance in a Step-by Step manner.

Is cPanel free?

cPanel is not free. However, 15 days test licences are available for new users. You can learn more about cPanel  trial licences from their official page.

How much does cPanel cost?

 The cPanel pricing could vary widely, depending upon the number of accounts. For a single cPanel hosting account you will be paying $15 per month. For 5 cPanel accounts you will be paying around $20 /month. The hosting cost could get much lower if you need more than 5 accounts. For example, up to 30 accounts you will be paying $30 per month and $45/month + $0.20 for each additional account for up to 100 accounts. Here is a link of cPanel official website.

To install cPanel on your Google Cloud Instances follow the below steps,

Step 1: Creating a new VM Instance

In this step we are going to create a new CentOS 7 VM instance for cPanel & WHM installation. We are creating a new VM because cPanel recommand us to install cPanel & WHM on a freshly-installed operating system.

Log in to your Google Cloud account. On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

Now, Navigate to Compute Engine >> VM instances.

After that, Click on ‘Create’ to launch a new VM instance.

Name: It is your instance name. Give any name as you wise.

Region: Choose a specific geographical location, this is where google cloud going to setup your CentOS 7 server for cPanel & WHM installation. Here is a link of google cloud website for more information.

Zone: Every region on Google Cloud has one or more zones. For example, the us-east1 region denotes a region on the east of the United States that has three zones: us-east1-bus-east1-c, and us-east1-d.

Machine type: Chose a machine as per your budget or need. From the cPanel & WHM System Requirements, we know that CentOS 7 will require at least 1GB of RAM and a minimum of 20GB disk space. Here I choose n1-standard-1 which has 1 vCpu and 3.75 Gb memory(ram), you also can choose g1-small which has 0.5 vCpu and 1.7 GB ram. Here is link of google cloud website  for more information. 

Boot Disk: Click the Change button to select CentOS 7 system image.

Now, navigate to OS images and choose CentOS 7 from the section menu.

Boot disk type: Choose a a minimum of 20 GB disk space. Google has two type of boot disk, SSD persistent disk (SSD) and  Standard persistent disk (mechanical hard disk). Because you are going to host a cPanel server, I recommand you to choose SSD.

Firewall: If you want to set up a web server, then check the boxes to allow HTTP and HTTPS traffic. It will open 80, 443 ports in google cloud firewall.

Finally, Again click the Create button, to deploy your CentOS 7  VM for cPanel & WHM installation.

Step 2: Reserving a Static IP address

By default, Google cloud VMs External IP address could change automatically. But you will need a static IP address for cPanel & WHM licence.

Before we are going to reserve a static IP address, we will test your current experimental IP address for cpanel trial licence. 

First, Copy you External IP address from Google Cloud Compute engine >> VM instances section.

After that, open the Cpanel licence verification page and paste your server external IP address for verification.

If it says “not licenced” then by following the below steps reserved that IP address, but if it says “licenced” then you need a new IP address for cpanel trial licence. You can get a new experimental IP address by restarting your VM instance from your Google Cloud dashboard.

After you have successfully verified your IP address, from Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen. Then, navigate to Networking >> VPC network >> External IP addresses.

Now, from the type section, choose Static. After that Give a name and click on the reserve button.

Step 3: Creating a sub-domain for cPanel

In this step we are going to create a sub-domain for our cPanel & WHM installation. By doing this we can access cPanel & WHM via a domain name. You can also access your cPanel from your server IP address. Later, we will use this sub-domain as our cpanel server hostname.

Depending on your domain registrar or DNS provider, the screenshots may look different. However, the basic concept is the same.

To access my cpanel via cpanel.siteyaar.com domain-name, I need to point A name to my VM instance IP address from my DNS provider dashboard. If you are not familiar with this process then you can check this blogs.

  1. 5 steps to connect your GoDaddy domain to Google Cloud VMs 
  2. Cloud DNS | How to Transfer your Domain to Google Cloud DNS

Because I am using Cloudflare as my DNS server, I added an A  name from Cloudflare DNS management section.

If  you are also using Cloudflare and also want to create a subdomain as cpanel. your-domain-name.com, then navigate to DNS Management section, after that click on ‘add record’. Then choose ‘A’ from Type field. Type cpanel in the ‘Name*’ field. Paste your Google Cloud VM instance external IP address on the IPv4 address field. Lastly, press the save button to add the new A record.

GoDaddy: If you’re using your default GoDaddy DNS and want to create cpanel.your-domain-name.com then login to your GoDaddy account then navigate to Home>>Manage My Products>>Domains>>DNS.  After that click on  button under the Records tab. 
  1. Type: As record type, choose A.
  2. Host: Type cpanel.
  3. Points to: Enter the external IP address of your Google cloud server. In this example, it is 35.193.115.138
  4. TTL (Time To Live):  TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
  5. Click  to apply the settings.

Step 4: Configuring Firewall for cPanel

A cPanel & WHM server requires multiple ports to operate functionality. But by default, Google cloud blocks all the ports except some few ones (SSH- 22, HTTP- 80, HTTPs- 443). To open requires Ports we will modify and add some new rules in Google Cloud firewall. Here is a link of cPanel official website for more details.

Here are the ports which we are going open in Google Cloud Firewall.

  • FTP: TCP : 20,21 
  • Email: TCP :25, 26, 110, 143, 465, 579, 993, 995  UDP: 465
  • DNS: TCP: 53 UDP: 53
  • cPanel: TCP: 783, 873, 2703, 2077,  2078, 2079, 2080, 2082, 2083, 2086, 2087, 2089, 2095, 2096, 2195, 6277, 24441 UDP: 783, 873, 6277, 24441

On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.  Then navigate to VPC network >> Firewall rules.

After that click on  “CREATE FIREWALL RULE” button from the top section of your screen.

Give a suitable name for your new firewall rule. Because I am going to open the cPanel ports, I typed cPanel in Name field.

Now leave the “Direction of traffic” and “Action on match” on default settings.

Targets: Choose  All instances in the network.

Source filter: Choose IP ranges.

Source IP ranges: Type 0.0.0.0/0

 

Select “Specified protocols and ports” from the protocols and ports section. After that place this ports 783, 873, 2703, 2077,  2078, 2079, 2080, 2082, 2083, 2086, 2087, 2089, 2095, 2096, 2195, 6277, 24441 on TCP field and 783, 873, 6277, 24441 in UDP field. 

Lastly, click the Create button to apply the changes.

Just like the cpanel rule create a new firewall rule for email.

Just like the image above You will see a similar screen if you create a new firewall rule for FTP.

CPanel & WHM  installation also came with DNS blind server that is why in the above image I am opening a port for DNS server.

The above image is a screenshot of my Google Cloud Firewall rule section. As you can see that I opened ports for cPanel, DNS, email, and ftp.

Step 5: Preparing for cPanel & WHM installation

In these steps we are going to prepare our VM instance for error free cPanel & WHM installation. We are going to do it by installing and removing some CentOS applications.

 From your Google cloud dashboard, navigate to compute engine >> VM Instances. Then, Open SSH terminal by simply clicking “SSH” next to our instance details under Connect.

Once in the terminal, I was logged in as a non-root user. To change to root, use:

sudo -s

Now that you are root, perform a few minor updates and installs to get started:

 
yum update -y

yum install -y perl yum install -y wget

The Network Manager service automates the network’s settings. It also disrupts connections to the IP addresses that reside in the ipaliases module. You have to remove Network Manager to install cPanel & WHM.

To disable Network Manager, run the following command:

yum remove NetworkManager

To access cPanel & WHM via a domain name we have to assign a hostname to the server. In the previous step we created a new subdomain, In this step we are going assign that sub domain as hostname.

Run the following command, where cpanel.example.com represents your desired hostname:

hostname cpanel.example.com

Step 6: Installing cPanel & WHM

cPanel & WHM installation process is very simple, you just have to execute a command on your SSH terminal. That command will download and execute  a cPanel & WHM installation script which automatically install and modify all necessary application and settings.

To install cPanel & WHM on your server, run the following command:

cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest

This command changes your session to the home directory, downloads the latest version of cPanel & WHM, and runs the installation script.

It will take around 15 – 40 minutes to complete the installation. Don’t close the terminal until the setup is completed.

Step 7: Fixing Hostname issue

To configure VPS deployments, Google Cloud Platform uses the  dhclient script, which includes the configuration of the instance’s hostname.

The dhclient script may not preserve the locally-configured hostname, so hosting providers use scripts to work around this issue. For example, Google Cloud Platform Services™ uses the google_set_hostname script.

The workaround scripts may interfere with WHM’s Change Hostname feature (WHM >> Home >> Networking Setup >> Change Hostname), which causes hostname configuration issues and a locked cPanel & WHM license.

To solve this issue we are going to set a “exit” hook script which will set the hostname properly at boot-time.

Remember to replace cpanel.example.com with your own hostname.

mkdir -p /etc/dhcp/dhclient-exit-hooks.d/ && echo -ne '#!/bin/sh\nhostname cpanel.example.com\n/scripts/fixetchosts\n' > /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh && chmod +x /etc/dhcp/dhclient-exit-hooks.d/zzz-set-hostname.sh

Step 8: Log in to WHM

Once you have successfully installed cPanel & WHM on your Google Cloud VM instance, It is time to log in to your WHM (Web Host Manager) account.

You will need your Linux OS(s) root credential to access your WHM account.

To update or reset the root password execute the command below,

passwd

Log in to WHM.

To log in to WHM, perform the following steps:

  1. Navigate to the following URL, where IPADDRESS represents your server’s IP address and cpane.example.com your server’s hostname:


    OR,

  2. Enter your username as root and password as root user(S) password.
  3. Click Log in.

Step 9: Configuring WHM

Once you successfully logged in to WHM account for first time, you have to agree to Cpanel & WHM terms to access cPanel.

After that type your Email Address on the Email address field. Cpanel will send status and minor notification to that address. After that click the Finish button.

Step 10: Log in to cPanel

To log in to cPanel, first you have to create and configure a new account from WHM dashboard. 

First, click the WHM logo on your top right-hand conner. After that click the Create a new Account button to create a new cpanel account.

Here is a link of Cpanel official website  which will help you to configure the new cpanel account.

Now it is your time!

I tried my best to provide you a complete tutorial on how to Instal cPanel & WHM on Google Cloud Compute engine. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks

Google Cloud SFTP Setup with FileZilla (with screenshots)

Do you want to transfer files from your computer (PC) to Google Cloud Instances with Filezilla?  Then don’t worry I am here to help you.

FileZilla is a free software, cross-platform FTP / SFTP application, Two different versions of it is available one is Filezilla client and another Filezilla server. You will be using Filezilla client in this tutorial. Filezilla client is available for Windows and macOS.

How to transfer file to Google Cloud with FileZilla?

Basically there are two ways which you can follow to transfer files to Google Cloud with Filezilla. First, using FTP (File Transfer Protocol), but Google Cloud  VM instance does not come with a pre-installed FTP server, so you have to set up an FTP server, in order to connect to Google Cloud using FTP. Here is a blog of mine which help you to Set up an FTP server on GCP. Second, using SFTP (SSH File Transfer Protocol) which we are going to discuss in the blog. SFTP is more secure than FTP and because Google Cloud instance came with SSH, you don’t need to install anything on your VM instance to transfer files using SFTP with Filezilla.

Here are the steps to set up SFTP with Filezilla on Google Cloud,

Step 1: Downloading PuTTY and FileZilla

The first step in this tutorial is to download PuTTY and FileZilla.

PuTTY is a  (free and open-source) SSH and telnet client, it helps us to open terminal emulator via SSH.  But in this tutorial we don’t using Putty rather its handy extra application name, PuTTYgen. Later in this tutorial we’ll use PuTTYgen to generate RSA Keys.

FileZilla is a free software, cross-platform FTP application. The FileZilla Client not only supports FTP, but also FTP over TLS (FTPS) and SFTP. Later in this guide we’ll show you how to configure Filezilla to transfer files to Google cloud.

Step 2: Generating RSA SSH keys

After you have downloaded and installed PuTTY on your local computer, It is time to generate RSA Public and Private keys. RSA Public and Private keys often called by SSH keys.

Now click on your window button. Then search and open PuTTYgen to generate Public and Private keys.

Click on “generate” and move your mouse to create SSH key pair (public and private keys).

I recommended you to change the key comment field to something recognizable and easy to type, as this will become a user name later!

This part is one of the most important step of this tutorial.

We are going to save the generated private key to our local computer. Later we going to use this private key to configure FileZilla.

Click on the “Save private key” button to save the private key on your computer.

In this step we are going to copy the public key, and in the next, going to apply it to your project or instance.

In the top, just under the Key section, copy the whole “Public key for pasting into OpenSSH authorized_keys file:” data. This is your public key. You also press “Save public key” to store it on your computer.

Step 3: Appling Public key to Google Cloud

In this step we are going to apply the SSH Public key to Google Cloud. There are two ways of doing it, either you can apply it to google cloud project(s) metadata or your VM instance(s) SSH keys section.

If you add the public key to project(s) metadata, Google Cloud will automatically apply it to all the VM instances (under your project). But if you add the public key to your VM instance(s) SSH keys section, it will enable SFTP for only that particular VM instance.

1. Adding Public key to Google Cloud Project(s) Metadata

Click on the hamburger menu in the upper left-hand corner of your Google Cloud Platform dashboard.

Now, navigate to Compute Engine >> Metadata >> SSH keys.

After that Click on Add item and Paste the  Public key which you copied from the puttygen application. Then click on the save button.

The metadata public key will work for all the VM instances.

2. Adding Public key to Google Cloud VM instance

Click on the hamburger menu in the upper left-hand corner of your Google Cloud Platform dashboard.

After that, navigate to Compute Engine >> VM Instances.

Open the setting section by clicking over the name of your VM instance.

Click on the edit Button.

After that scroll down and click on the “Show and edit” Button.

You need to paste the Public key which you copied earlier from the puttygen application.

Now, click “Save” to apply the public key to only this instance.

Step 4: Appling Private key to Filezilla

In this step we are going to add the private SSH key to Filezilla(S) settings section.

Open the Filezilla Client application which you have already downloaded and installed on your local computer. Now, navigate to Edit >> Settings.

  1. – Navigate to Connection >> SFTP.
  2. – Click the “Add key file..” button.

Now, select the private key file which you saved from PutTTYgen.

3. – Click the OK button to apply the private key to FileZilla.

Step 5: Configuring FileZilla

In this step we are configuring FileZilla to make a connection to Google cloud.

On your Filezilla client application, navigate to File >> Site Manager.

  1. – To a new project, click on New Site.
  2. – Give a name (optional)

After that, Select “SFTP – SSH File Transfer Protocol” from Protocol field.

3. – Go to you google cloud (s) dashboard and copy your VM instance External IP address.  Now, Paste the IP address to the Host field (filezilla).

4. – Type the username or key-comment (which you get from PuTTYgen application) on the “User:” field.

5. Press the “OK” button to apply the settings to Filezilla.

Step 6: Connecting to Google Cloud

On your Filezilla client application, again navigate to File >> Site Manager.

After that, click on “Connect” to connect to google cloud via SFTP.

If  you have successfully connected to GCP , you will see an output similar to the image above. Because I used username (as key-comment and later type it on Filezilla’s host section), I connected to /home/username directory.

Step 7: Transferring Files to Instances

Once, you have successfully connected to Google Cloud using Filezilla, It is time to check whether you can or cannot transfer a file to your Instances.

Just drag and drop a file  from your local computer to /home/your-username(key-comment). 

If the file transfer was successful, then you will see an output similar to the image above.

Here I transfer wp-config.php file from my pc to  VM Instance (s) /home/username directory. 

If your file transfer failed then check the Troubleshooting Step for more information. 

Step 8: Troubleshooting Filezilla errors

If you file transfer failed or seeing “permission denied” error, its probably because of “Linux user and group permissions” system.

Here is the Filezilla(s) error,

Error /...  : open for write:permission denied

Error File transfer failed

I assume that you’re seeing this error when you tried to edit or transfer a file other than /home/your-key-comment(username) directory. In Linux system every file and directory have a owner and group, if the file or directory does not belong to your key-comment(username) then you can not edit or upload files. 

To solve permission denied error of filezilla follow this tutorial below,

Now it is your time!

I tried my best to provide you a complete tutorial on how to set up SFTP on Google Cloud with Filezilla. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thank

Create a VM Instance with Debian 9 on Google Cloud

Creating a new Debian 9 (Stretch) virtual server (VM) on Google Cloud is a very easy. It is nothing like the installation process which you may encounter while installing  Debian 9 on  Local computer(PC or Laptop). In this blog, I will show you in a Step-by-step manner, how to create a VM server with Debian 9 (Stretch) on Google Cloud.

Google Cloud has two ways, which you can follow to install  9 (Stretch) (s) on boot disks.

  • Using Public images : These type of system images are provided and maintained by Google, open-source communities, and third-party vendors. By default, all projects have access to these images and can use them to create instances. The process of creating a VM out of public image is very simple. 
  • Using Custom images: These type of images are available only to your project. You can create a custom image from boot disks and other images. Then, use the custom image to create an instance. You should only follow this method if  you want to import your Debian 9 (stretch) from other cloud server or want to install it from Raw- system images. Here is a Google Cloud Link for more information.

In this tutorial, we’ll use Google Cloud Debian 9 (Stretch) Public Image to create a VM server.
So, let’s get started,

How much it cost to create a Debian 9 (Stretch) VM server on Google Cloud?

There are is no extra charge for Debian 9 (Stretch)  but you have to pay for your VM instances.

Prerequisites

  • A working Google Cloud account
  • And little Patience.

Step 1- Create an new Instance

Log in to your Google Cloud account. On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

Log in to your Google Cloud account. On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

Now, Navigate to Compute Engine >> VM instances.

After that, Click on ‘Create’ to launch a new VM instance.

You also can Launch Debian 9 (Stretch) from Google cloud Marketplace

Step 2- Configuring VM Instance with Debian 9 (Stretch)

After you have launch your VM instance, it is time to configure your VM.

Name: It is your instance name. Give any name as you wise.

Region: Choose a specific geographical location, this is where google cloud going to setup your Debian 9 (Stretch) server. Here is a link of google cloud website for more information.

Zone: Every region on Google Cloud has one or more zones. For example, the europe-west2 region denotes a region on the west of the Europe that has three zones: europe-west2-aeurope-west2-b, and europe-west2-c.

Machine type: Chose a machine as per your budget or need. Here I choose f1-mini which has 0.2 vCpu and 614 MB ram. Here is link of google cloud website  for more information. 

Here is the most important part of this tutorial, If you launch  Debian 9 (Stretch) from google cloud marketplace, then you don’t need to change your Boot disk to Debian 9 (Stretch).

Boot Disk: Click the Change button to select Debian 10 system image.

Now, navigate to OS images and choose Debian GNU/Linux 10 (buster) from the section menu.

Boot disk type: Choose your boot disk type and size. Google has two type of boot disk, SSD persistent disk (SSD) and  Standard persistent disk (mechanical hard disk). If you want to set up a web server then I recommand you to choose SSD.

Firewall: If you want to set up a web server, then check the boxes to allow HTTP and HTTPS traffic. It will open 80, 443 ports in google cloud firewall.

Finally, Again click the Create button, to deploy your Debian 9 (Stretch) VMs on google cloud.

Step 3- Reserve an IP Address

You can ignore this step if you don’t need a static IP address. By default, Google cloud VMs External IP address could change automatically. If you are going to set up a web server or need a fix IP for your work then you should reserve a static IP address. Follow the below steps to reserve IP address.

On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen. Then, navigate to Networking >> VPC network >> External IP addresses.

Now, form the type section, choose Static. After that Give a name and click on the reserve button.

Step 4- Setting up your Debian 9 (Stretch) Server

If you are a beginner, then you will face many difficulties.  It takes me many days to figure out how to use Google Cloud Platform. 

Those following tutorial will help you to increase your productivity and usability. And also help you to save your valuable time.

Initial Server Setup with Debian 9 (Stretch) on Google Cloud

After you have created a new Debian 10 server, there are a few configuration steps that you should take early on as part of the basic setup. Those steps will increase the security and usability of your server and also help you to build a solid foundation for subsequent actions. 

Cloud Platform usually don’t have any built in file management or transfer (upload and download basically) system, Google Cloud is not exceptional in this regard. 

To transfer your files to your Debian 9 (Stretch) VM, you have to set up SFTP.

Now it is your time!

I tried my best to provide you a complete tutorial on  How to create a Debian 9 (Stretch) VM on  Google Cloud Platform. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks,

Create a VM Instance with Debian 10 | Google Cloud

Creating a new Debian 10 virtual server (VM) on Google Cloud is a very easy task. It is nothing like the installation process which you may encounter while installing  Debian 10 on  Local computer(PC or Laptop). In this blog, I will show you in a Step-by-step manner, how to create a VM server with Debian 10 on Google Cloud.

Google cloud has two ways, which you can follow to create a Debian 10 (s) boot disks for your instances.

  • Public images : These type of images are provided and maintained by Google, open-source communities, and third-party vendors. By default, all projects have access to these images and can use them to create instances. 
  • Custom images: These type of images are available only to your project. You can create a custom image from boot disks and other images. Then, use the custom image to create an instance.

In this tutorial, we’ll use Google Cloud Debian 10 public image to create a VM server.
So, let’s get started,

How much it cost to create a Debian 10 VM server on Google Cloud?

There are is no extra charge for Debian 10  but you have to pay for your VM instances. As you can see on the image Debian 10 usage fee is $0.00/month, but n1-standard-1 server is $36.50/month. After getting Sustained-use discount its only $25.95/month.

Prerequisites

  • A working Google cloud account 

Step 1- Create an new Instance

Log in to your Google Cloud account. On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

Now, Navigate to Compute Engine >> VM instances.

After that, Click on ‘Create’ to launch a new VM instance.

You also can Launch Debian 10 (Buster) from Google cloud Marketplace

From your Google cloud dashboard menu click on the Marketplace.

After that type Debian 10 on the search bar, and open the Debian 10 from result.

Click on the “LAUNCH ON COMPUTE ENGINE” to create a new Debian 10 VM instance.

Step 2- Configuring VM Instance with Debian 10

After you have launch your VM instance, it is time to configure your VM.

Name: It is your instance name. Give any name as you wise.

Region: Choose a specific geographical location, this is where google cloud going to setup your Debian 10 server. Here is a link of google cloud website for more information.

Zone: Every region on Google Cloud has one or more zones. For example, the us-east1 region denotes a region on the east of the United States that has three zones: us-east1-bus-east1-c, and us-east1-d.

Machine type: Chose a machine as per your budget or need. Here I choose g1-small which has 0.5 vCpu and 1.7 GB ram. Here is link of google cloud website  for more information. 

Here is the most important part of this tutorial, If you launch  Debian 10 from google cloud marketplace, then you don’t need to change your Boot disk to Debian 10.

Boot Disk: Click the Change button to select Debian 10 system image.

Now, navigate to OS images and choose Debian GNU/Linux 10 (buster) from the section menu.

Boot disk type: Choose your boot disk type and size. Google has two type of boot disk, SSD persistent disk (SSD) and  Standard persistent disk (mechanical hard disk). If you want to set up a web server then I recommand you to choose SSD.

Firewall: If you want to set up a web server, then check the boxes to allow HTTP and HTTPS traffic. It will open 80, 443 ports in google cloud firewall.

Finally, Again click the Create button, to deploy your Debian 10 VMs on google cloud.

Step 3- Reserve an IP Address

You can ignore this step if you don’t need a static IP address. By default, Google cloud VMs External IP address could change automatically. If you are going to set up a web server or need a fix IP for your work then you should reserve a static IP address. Follow the below steps to reserve IP address.

On your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen. Then, navigate to Networking >> VPC network >> External IP addresses.

Now, form the type section, choose Static. After that Give a name and click on the reserve button.

Step 4- Setting up your Debian 10 Server (optional)

If you are a beginner, then you will face many difficulties.  It takes me many days to figure out how to use Google Cloud Platform. 

Those following tutorial will help you to increase your productivity and usability. And also help you to save your valuable time.

Initial Server Setup with Debian 10 on Google Cloud

After you have created a new Debian 10 server, there are a few configuration steps that you should take early on as part of the basic setup. Those steps will increase the security and usability of your server and also help you to build a solid foundation for subsequent actions. 

Cloud Platform usually don’t have any built in file management or transfer (upload and download basically) system, Google Cloud is not exceptional in this regard. 

To tanasfer your files to your debian 10 VM, you have to set up SFTP.

Now it is your time!

I tried my best to provide you a complete tutorial on  How to create a Debian 10 VM on  Google Cloud Platform. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks,

Setting Up DNSSEC on Google Cloud DNS

Enabling DNSSEC on your Google Cloud DNS is child’s play, click one button and Google Cloud DNS will automatically create all necessary DNSKEYs for you. But it could get little complicated if you don’t know how to add DS record on your domain registrar website. That is why, In this blog I will help you to configure DNSSEC in a Step-by-step manner. 

First let’s explain some stuffs. 

What is DNSSEC?

We all know that DNS is a protocol which resolves domain names to IP addresses, but how do we know the authenticity of the returned IP address? It is possible for an attacker to  easily masquerade as the authoritative server that a resolver originally queried by spoofing a response that appears to come from that authoritative server. In other words an attacker can redirect a user to a potentially malicious site without the user realizing it.

To combat this type of attacks Domain Name System Security Extensions  (DNSSEC) was introduced in 2005. DNSSEC digital signatures  all the DNS data (A, CNAME, MX, etc) of using public key cryptography. Now if your user use a DNSSEC enabled DNS resolvers, it can verify the authenticity of a DNS reply using the public DNSKEY record. If you want to learn more about DNSSEC here are some Articles, which could help you in this regard.

  1. DNSSEC – What Is It and Why Is It Important? – by ican.org
  2. How DNSSEC Works – by Cloudflare

How DNSSEC works on Cloud DNS?

When we’ll enable DNSSEC on Cloud DNS, it will automatically create  public keys (DNSKEY) and Private Keys. Next We have to add the public key to your domain registrar website. Your domain registrar will add your public key to Top-level-domain TDL server. Your Top-Level-Domain TDL DNS server also have Private keys and Public Keys and it’s the public key already added to Root nameserver.

Now, when a resolver sends a DNS query to root server, root server replay with  TDL nameservers DNS zone data and public keys. After that resolver again send a DNS query to TDL nameserver, the TDL name server replay with a public key  and Cloud DNS zone data. Then the resolver, validate the data of TDL nameserver using public key (receive from root nameserver). Next the resolver send a query to Cloud DNS, – replay with Your domain(s) zone records. Again resolver validate that data using public key – receive from TDL nameserver.  The actual mechanism is more complicated–but the effect is the same.

 

How much it cost to enable DNSSEC on Cloud DNS?

There is no additional charges or changes  for enabling DNSSEC on Cloud DNS. But you have to pay  for Cloud DNS which is  $0.20 per domain (zone) and $0.40 per million queries per month.

Prerequisites

  1. Already have a top-level-domain name.
  2. The domain registrar have DNSSEC support.
  3. You have migrated your DNS to Google Cloud DNS. Here is some article which will help you in this regard,

DNSSEC Resource Records

Just like DNS resource records (A, AAAA, CNAME, MX …), DNSSEC also requires several RR(s).

  1. Delegation signer (DS): The record used to identify the DNSSEC signing key of a delegated zone
  2. DNS Key record (DNSKEY): The key record used in DNSSEC. Uses the same format as the KEY record.
  3. DNSSEC signature (RRSIG): Signature for a DNSSEC-secured record set. Uses the same format as the SIG record.

Step 1: Enabling DNSSEC on Cloud DNS domains

Click on the hamburger menu in the upper left-hand corner of your Google Cloud Platform dashboard. After that navigate to NETWORKING >> NETWORK SERVICES >> CLOUD DNS.

As you can see, On the above image, We already set up our domain on Cloud DNS. To enable DENSEC,just click the DNSSEC setting for the zone and select “On” in the pop-up menu.

In the confirmation dialog that appears, just click the Enable button.

Step 2: Opening domain(s) DS records

In the previous step you have enabled DNSSEC on Cloud DNS. Now, we’ll transfer the DS record to your domain registrar website. To do we need to open the Registrar Setup section.

Click on your Zone name.

Next, in your right-hand corner click the “Registrar Setup” button.

  1. Key Tag:   57710
  2. Algorithm: rsasha256(8)
  3. Digest Type: sha256 (2)
  4. Digest: 9691BF6F8285D6D7973B2B6B5AC851DB8EA745451CD7BF268BAEE31989B5708F
  5. DS:    Key-Tag   Algorithm    Digest-Type   Digest

As you can see that DS record is a combination of all those four records.

Step 3: Configuring DS records with your registrar

In this step we are going to add Those DS records on your domain registrar website. 

As you know there are hundreds of domain registrar and all of them might have DNSSEC management page in different locations, It is not viable for me to show you the steps for all those different registrar. To help you as much as I can, I will be showing you how to configure DS record with GoDaddy and Namecheap.

 

Example no 1: GoDaddy

Log in to your GoDaddy account, then navigate to Home >> Manage My  Products >> DNS. Now scroll down to “Advanced Features” just below the Nameservers section, and click on the DNSSEC button.

Now, One by one paste Key-Tag, Algorithm, Digest-type, Digest which you copied from Cloud DNS(s) registrar setup section.

Example no 2: Namecheap

Log in to your Namecheap account. After that, navigate to “Domain List” >> Advanced DNS. There on DNSSEC section toggle the button to enable DNSSEC.

Now, One by one paste Key-Tag, Algorithm, Digest-type, Digest which you copied from Cloud DNS(s) registrar setup section. 

Step 4: Verifying DNSSEC deployment

Once you have added/updated those DS records, it can take time up to 24 hours for the changes to be effective across the internet.

You can use DNSVizZonalizer, the Verisign DNSSEC debugger, or Zonemaster to verify correct deployment of your DNSSEC-enabled zone.

Here what looks like in the Verisign DNSSEC debugger when you  have successfully deployed DNSSEC.

Here what looks like in  DNSViz  when you have successfully deployed DNSSEC on your domain.

Now it is your time!

I tried my best to provide you a complete tutorial on  How to transfer your domain to Google Cloud DNS. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks,

Setting up Google Cloud DNS for your Godaddy domain

Transferring your GoDaddy domain to Google Cloud DNS could overwhelm you if you are not familiar with the configuration. That is why, In this blog I will help you to transfer your GoDaddy Domain to Google Cloud DNS.

In the first part we’ll configure Google Cloud DNS for your GoDaddy domain, after that we’ll point your nameserver to Cloud DNS.

Prerequisites

  1.  A domain name, registered from GoDaddy.
  2. A working  web server, It could be your Google Cloud  VM Instances or any other web server which hosted by different service provider (such as – cpanel, aws web server etc). As long, you have a server IP address it does not matter. If you want to install wordpress on Google Cloud, check out this blog.
  3. And an internet connection!! 

Commonly used DNS Records

DNS servers create a DNS record to provide important information about a domain or hostname, particularly its current IP address. The most common DNS record types are:

  • Address Mapping record (A Record)—also known as a DNS host record, stores a hostname and its corresponding IPv4 address. 
  • IP Version 6 Address record (AAAA Record)—stores a hostname and its corresponding IPv6 address.
  • Canonical Name record (CNAME Record)—can be used to alias a hostname to another hostname. When a DNS client requests a record that contains a CNAME, which points to another hostname, the DNS resolution process is repeated with the new hostname.
  • Mail exchanger record (MX Record)—specifies an SMTP email server for the domain, used to route outgoing emails to an email server.
  • Name Server records (NS Record)—specifies that a DNS Zone, such as “example.com” is delegated to a specific Authoritative Name Server, and provides the address of the name server.
  • Text Record (TXT Record)—typically carries machine-readable data such as opportunistic encryption, sender policy framework, DKIM, DMARC, etc.

Step 1: Creating Google Cloud DNS Zone

Click on the hamburger menu in the upper left-hand corner of your Google Cloud Platform dashboard. After that navigate to NETWORKING >> NETWORK SERVICES >> CLOUD DNS.

After that click on “Create zone”.

After that select “Public” from Zone type field. Then type a Zone name. Place your Domain name on the DNS Name field. Next click on Create button.

Those are the nameservers records of Cloud DNS which you have to place in the nameserver field of your domain registrar website. Copy these NS records one by one.

Step 2: Finding Godaddy domian(s) DNS zone Records

In this step we are going to find your current DNS zone records and In the next step we are going to transfer it to google cloud DNS. There are four possibilities,

  1. You have a working website and using GoDaddy(s) default DNS.
  2. Using a Google Cloud VM Instances.
  3. Using Cpanel as hosting platform and want to use Cloud DNS.
  4. Using Cloudflare CDN.

1. Using GoDaddy(s) default DNS

If you are not using Cloudflare CDN or Cpanel, and still can access your website through your domain then Its  highly possible that you’re using your GoDaddy(s) default DNS. There is another way of verifying this, open your GoDaddy domain (s) DNS Manage section and check  for Records. If Records section is blank that mean you are not using it.

Go to your GoDaddy website and login to your GoDaddy account by clicking the ‘Sing In’ Button. Next, click on the home button and navigate to ‘Manage My Products’.

Next Open the DNS Manager by clicking the ‘DNS’ button.

​Now, by following the next step, create exact same zone records on Google cloud DNS.​

4. Using  Google cloud VM instances.

Log in to your Google cloud account and navigate to Compute engine >> VM instances. After that, copy your VM(s) external IP address.

Next, by following the next step, Create “A” record on Google Cloud DNS using your VM instances External IP address.

It is also possible to connect to your GoDaddy(s) domain to Your Google Cloud VM Instances without using Cloud DNS, check out this blog for more information.

3. Using Cpanel

Login to your cPanel and navigate to DOMAINS >> Zone Editor >> Manage. After that, Create  Exact same DNS records on Cloud DNS.

4. Using Cloudflare CDN:

Logging to your Cloudflare Account and goto your DNS section and create exact same DNS records on Cloud DNS.

Step 3: Migrating DNS zone Records to Cloud DNS

In the previous steps you learn how to find your DNS record. Now In this step we are transferring those records by creating an exact copy record on google cloud DNS, 

Now  click on the Add record set on Google cloud DNS  and one by one migrate your DNS records.

Transfer A records

Dns Name:Choose the host for the domain/subdomain that you want to point to your Google Cloud. In this example, we have chosen a naked domain(siteyaar.com) so Under Host, type @ if you’re going to point a domain (such as mysite.com).
Resource Record Type:Choose A.
TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
Ipv4 Address: Type your server ip address or type the Ip address from you privious dns records.
Click the Create button to save the record.

Need more help? Then check the Example.

Transfer CNAME records

Dns Name: Generally we type @ or yoursite.com in this field.
Resource Record Type:Choose CNAME.
TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
Canonical name: In this section type your subdomain name. Example- www.yoursite.com, fun.yoursite.com etc.
Click the Create button to save the record.

Transfer MX records

Dns Name: Copy from your privious records.
Resource Record Type:Choose Mx.
TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
Preference and mail server:[Type your preference number] give a space [your mail server address]
Click the Create button to save the record.

Transfer TXT records

Dns Name: Type your domain or subdomain in here.
Resource Record Type:Choose TXT.
TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
TXT data: Type your text value
Click the Create button to save the record.

 

Examples:

Creating A record for naked domain. (mysite.com)

  1. Dns Name:Leave it blank. Normally we type @ to create a naked domain(s) A record, but in Cloud DNS it is Blank.
  2. Resource Record Type:Choose A.
  3. TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
  4. Ipv4 Address: Type your server ip address or type the Ip address from you privious dns records. Here we typed 35.225.167.62 which is our Google Cloud VM external IP address.
  5. Click the Create button to save the record.

Creating A record for subdomain domain. (www.mysite.com)

  1. Dns Name:Type www to create a www.mysite.com subdomain.
  2. Resource Record Type:Choose A.
  3. TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
  4. Ipv4 Address: Type your server ip address or type the Ip address from you privious dns records. Here we typed 35.225.167.62 which is our Google Cloud VM external IP address.
  5. Click the Create button to save the record.

Creating CNAME record for subdomain domain. (www.mysite.com)

  1. Dns Name:Leave it blank. Normally we type @ to create a naked domain(s) A record, but in Cloud DNS it is Blank.
  2. Resource Record Type:Choose A.
  3. TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
  4. Canonical name: Here we type www.mysite.com to create a subdomain using CName.
  5. Click the Create button to save the record.

Step 4: Point Nameserver to Cloud DNS

As you already know, that your domain registrar website is connected to the TLD Nameserver. When you  Change the Nameserver records from your domain registrar site, TLD server also get updated, BUT it can take up to 48 hours.

For shake of this tutorial we are showing you how to change  NS records of GoDaddy and Namecheap website. If your domain registrar is different from those two, then place a comment or search it on Google.

Pointing GoDaddy domain to Cloud DNS

Log in to your GoDaddy account, then navigate to Home >> Manage My  Products.

Now click the DNS button.

Now scroll down to Nameservers section, and click on the Change button.

After that, Select “Custom” from the “Choose your new nameserver type” section. Then, In the Nameserver field place the NS records which you copied earlier.

Step 5: Verifying DNS propagation

Once you have added/updated the DNS records, it can take time up to 24 hours for the changes to be effective across the internet.

You can check the status of your domain(s) propagation by using some available online tool such as dnschecker.org 

 

Now it is your time!

I tried my best to provide you a complete tutorial on  How to Setting up Google Cloud DNS for your GoDaddy domain. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks,

Cloud DNS | How to Transfer your Domain to Google Cloud DNS

Transferring your domain to a different DNS server could overwhelm you if you are not familiar with the configuration. That is why, In this blog I will help you to transfer your Domain to Google Cloud DNS.

How to transfer your Domain to Google Cloud DNS?

To transfer your domain to Google Cloud DNS, You have to point your nameserver to Cloud DNS from your domain register(s) website and also have to migrate your DNS record to Cloud DNS. Before stating Step-by-Step Instructions let me explain what is DNS nameserver and DNS records. If you want to skip the explanation part (click here). 

DNS:

DNS is a system which find the IP Address of a website (domain).

Domain name e.g. www.google.com is just like your smartphone contact name and IP address is like phone number.
Can you call someone with just contact name, of course not you can’t, you need a phone number, just like you need an IP Address to visit a website. There are billions of websites and every hour thousands of new website are created.  The systems which store and manage that huge data of  Domain names and IP addresses is called Domain Name System or DNS.
DNS server:
When a user open your website they get your blog or videos from your web server, just like that you also need a server which always broadcast your domain(s) IP information to your user. The server which store and broadcast  your IP information is called DNS Nameserver.

There are two type of DNS nameservers, Authoritative Nameserver and non-authoritative Nameserver. The nameserver which has your server IP address is called Authoritative Nameserver, example – Google Cloud DNS. And the nameservers which does not know your server IP address but know the name of the server which has the IP address is called non-authoritative nameservers, example- Root nameservers, TLD nameservers etc.

As you can see in the Image, User send a query to the DNS root Nameserver, root server replay it with TLD nameserver IP address, After that user again send a query to the DNS tld nameserver and tld server replay with it Google Cloud DNS server(S) IP. Finally, user send a query to the Google cloud DNS  nameserver and get your server IP address.

Commonly used DNS Records

DNS servers create a DNS record to provide important information about a domain or hostname, particularly its current IP address. The most common DNS record types are:

  • Address Mapping record (A Record)—also known as a DNS host record, stores a hostname and its corresponding IPv4 address.
  • IP Version 6 Address record (AAAA Record)—stores a hostname and its corresponding IPv6 address.
  • Canonical Name record (CNAME Record)—can be used to alias a hostname to another hostname. When a DNS client requests a record that contains a CNAME, which points to another hostname, the DNS resolution process is repeated with the new hostname.
  • Mail exchanger record (MX Record)—specifies an SMTP email server for the domain, used to route outgoing emails to an email server.
  • Name Server records (NS Record)—specifies that a DNS Zone, such as “example.com” is delegated to a specific Authoritative Name Server, and provides the address of the name server.
  • Text Record (TXT Record)—typically carries machine-readable data such as opportunistic encryption, sender policy framework, DKIM, DMARC, etc.

Step 1: Create Google Cloud DNS Zone

Click on the hamburger menu in the upper left-hand corner of your Google Cloud Platform dashboard. After that navigate to NETWORKING >> NETWORK SERVICES >> CLOUD DNS.

After that click on “Create zone”.

After that select “Public” from Zone type field. Then type a Zone name. Place your Domain name on the DNS Name field. Next click on Create button.

Those are the nameservers records of Cloud DNS which you have to place in the nameserver field of your domain registrar website. Copy these NS records one by one.

Step 2: Find Your DNS zone Records

In this step we are going to find your current DNS zone records and In the next step we are going to transfer it to google cloud DNS. There are four possibilities,

  1. You have a working website and using your domain registrar default or basic DNS.
  2. Using Cpanel
  3. Using Cloudflare CDN.
  4. Using a Google Cloud VM Instances.
  5. I have no Idea what you are saying.

1. Using domain registrar default DNS

If you are using your domain registrar default DNS then logging to your domain registrar website. After that navigate to DNS section and create exact same zone records on Google cloud DNS.

Example:

You can view the records by going to your GoDaddy(s) DNS manage section.  

If your domain registrar is Namecheap then You can view your DNS records by navigate to Domain list >> Advance DNS.

2. Using Cpanel

Login to your cPanel and navigate to DOMAINS >> Zone Editor >> Manage. After that, Create  Exact same DNS records on Cloud DNS.

3. Using Cloudflare CDN:

Logging to your Cloudflare Account and goto your DNS section and create exact same DNS records on Cloud DNS.

4. Using  a Google cloud vm instances.

Log in to your Google cloud account and navigate to Compute engine >> VM instances. After that, Create an “A” record on Google Cloud DNS using your VM instances External IP address.

5. I have no idea what you’re saying.

If don’t understand or non of the above example is working for you then just create A record using your server IP Address.

Step 2: Migrating DNS zone Records

In the previous steps you learn how to find your DNS record. Now In this step we are transferring those records by creating an exact copy record on google cloud DNS,

Now  click on the Add record set on Google cloud DNS  and one by one migrate your DNS records.

Transfer A records

Dns Name:Choose the host for the domain/subdomain that you want to point to your Google Cloud. In this example, we have chosen a naked domain(siteyaar.com) so Under Host, type @ if you’re going to point a domain (such as mysite.com).
Resource Record Type:Choose A.
TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
Ipv4 Address: Type your server ip address or type the Ip address from you privious dns records.
Click the Create button to save the record.

Transfer CNAME records

Dns Name: Generally we type @ or yoursite.com in this field.
Resource Record Type:Choose CNAME.
TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
Canonical name: In this section type your subdomain name. Example- www.yoursite.com, fun.yoursite.com etc.
Click the Create button to save the record.

Transfer MX records

Dns Name: Copy from your privious records.
Resource Record Type:Choose Mx.
TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
Preference and mail server:[Type your preference number] give a space [your mail server address]
Click the Create button to save the record.

Transfer TXT records

Dns Name: Type your domain or subdomain in here.
Resource Record Type:Choose TXT.
TTL:TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
TXT data: Type your text value
Click the Create button to save the record.

Step 2: Point Nameserver to Cloud DNS

As you already know, that your domain registrar website is connected to the TLD Nameserver. When you  Change the Nameserver records from your domain registrar site, TLD server also get updated, BUT it can take up to 48 hours.

For shake of this tutorial we are showing you how to change  NS records of GoDaddy and Namecheap website. If your domain registrar is different from those two, then place a comment or search it on Google.

Pointing GoDaddy domain to Cloud DNS

Log in to your GoDaddy account, then navigate to Home >> Manage My  Products.

Now click the DNS button.

Now scroll down to Nameservers section, and click on the Change button.

After that, Select “Custom” from the “Choose your new nameserver type” section. Then, In the Nameserver field place the NS records which you copied earlier.

Pointing Namecheap domain to Cloud DNS

Login to you Namecheap account. Then, navigate to Domain list >> Domain. Next Select Custom DNS from Nameserver section.

Select custom DNS and place the nameserver records which you copied from Google Cloud DNS.

Step 4: Verifying DNS propagation

Once you have added/updated the DNS records, it can take time up to 24 hours for the changes to be effective across the internet.

You can check the status of your domain(s) propagation by using some available online tool such as dnschecker.org 

 

Now it is your time!

I tried my best to provide you a complete tutorial on  How to transfer your domain to Google Cloud DNS. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks,

5 steps to connect your GoDaddy domain to Google Cloud VMs

If  you want to connect you GoDaddy domain to Google cloud VM Instances then you are in right place. In this tutorial you will learn 5 steps which will help you to connect your GoDaddy domain to Google cloud server.

How to Connect your GoDaddy domain to Google Cloud VM Instances?

By adding a ‘A’ record from your GoDaddy’s DNS Manager section you can connect your GoDaddy domain to google cloud. That ‘A’ records will contain the external IP address of your Google Cloud VM Instances. Having said that – you  also can archive that by using Google Cloud DNS (tutorial) or any third party DNS. Before starting this tutorial let’s give you a little explanation, 

DNS:

DNS is a system which find the IP Address of a website (domain).
Domain name e.g. www.google.com is just like your smartphone contact name and IP address is like phone number.
Can you call someone with just contact name, of course not you can’t, you need a phone number, just like you need an IP Address to visit a website. There are billions of websites and every hour thousands of new website are created.  The systems which store and manage that huge data of  Domain names and IP addresses is called Domain Name System or DNS.

DNS Nameserver:

In a nut shell DNS Nameservers stored your server IP address. When someone trying access your domain they send a query to the nameserver and nameserver responds it with your IP address.  There are two kinds of DNS nameservers, Authoritative Nameserver and non-authoritative Nameserver. The nameserver which has your server IP address is called Authoritative Nameserver, example – GoDaddy’s DNS server, Google Cloud DNS, AWS route 53, Other third-party DNS-s. And the nameservers which does not know your server IP address but know the name of the server which has the IP address is called non-authoritative nameservers, example- Root nameservers, TLD nameservers etc.
 

As you can see in the Image, User send a query to the DNS root Nameserver, root server replay it with TLD nameserver IP address, After that user again send a query to the DNS tld nameserver and tld server replay with it GoDaddy DNS server. Finally, user send a query to the GoDaddy nameserver and get your server IP address.

So, In this tutorial we are going to add your server (Google Cloud VM instances) IP address in you GoDaddy DNS nameserver by adding A record in it.

So, let’s get started,

 

Step 1: Opening GoDaddy DNS Manager

Go to your GoDaddy website and login to your Godaddy account by clicking the ‘Sing In’ Button.

After that click on the home button and navigate to ‘Manage My Products’.

Next Open the DNS Manager by clicking the ‘DNS’ button. 

Now, scroll down to Nameservers section and make sure that you are using default nameservers.

If you are seeing different nameserver, then it means that you are using a third-party DNS server such as Cloudflare, google cloud DNS, AWS route 53 etc. In this situation you have two options, either You can go to the DNS provider’s website and add A record from there or you can change the nameserver to default.

Step 2: Coping Your Google Cloud VM's external IP

Login to  your Google Cloud  dashboard and click the hamburger menu in the upper left-hand corner of the screen.

Now hover over Compute Engine and Click on VM Instances.

Now, Copy the external IP address of your Google cloud VM.

Step 3: Adding/Editing A record

Now back to your GoDaddy website’s tab, and click on  button under the Records tab.

  1. Type: As record type, choose A.
  2. Host: Choose the host for the domain/subdomain that you want to point to your Google Cloud. In this example, we have chosen a naked domain(siteyaar.com) so Under Host, type @ if you’re going to point a domain (such as mysite.com).
  3. Points to: Enter the external IP address of your Google cloud server. In this example, it is 35.238.221.27
  4. TTL (Time To Live):  TTL value tells your browser how long a record should be stored in cached before a new copy of the record must be retrieved from DNS. Select custom or use the default one.
  5. Click  to apply the settings.

Example 1: For main domain – siteyaar.com

 If you want to use your naked domain type @ in the Host field.

@ – represent your domain name.

Example 2: For sub-domain – www.siteyaar.com

If you want to use your domain with www then type in the host field.

Example 4: For wildcard sub-domain – *.siteyaar.com

If you type * in host field, it will create a wildcard record.

* – A wildcard record acts as a catch-all record, which means that it redirects every subdomain you haven’t defined elsewhere to an IP address.

Step 4: Editing or Deleting DNS records

Editing and deleting DNS records are straightforward on GoDaddy.

– First, select your target record, and in this example, we have A record and then click on the  edit button as shown below

– Now, If you want to edit your DNS record, you may click on the required field and edit and click on Save to save changes.

– Or, if you want to delete your DNS record, then you may click on the  trash button located in the top right corner.

Step 5: Verifying DNS propagation

Once you have added/updated the DNS records, it can take time up to 24 hours for the changes to be effective across the internet.

You can check the status of your domain(s) propagation by using some available online tool such as dnschecker.org 

Conclusion

If you are using google cloud as a web server for hosting your website then I recommand you to use a third party DNS server such as Google cloud DNS, Cloudflare etc. GoDaddy(s) default DNS is slower than Google Cloud DNS, Cloudflare, AWS route 53. By changing your GoDaddy DNS you can decrease your website(s) load time. 

Now it is your time!

I tried my best to provide you a complete tutorial on  How to Connect your GoDaddy domain to Google Cloud VM Instances. I hope you liked it.

If you need help just drop a comment.

If you benefited from this tutorial, and would like to support my work, please like my Facebook page.

Thanks,