Sudeep's Blog

Get free domain .com.np and free hosting

For Nepali citizens, you can register free .com.np domain. In this post, I will teach you to point this domain to Github Pages using Cloudflare DNS for free.

Mercantile Communications Pvt. Ltd. provides .com.np domain registration for free of cost and provides to use DNS service.

Step 1: Setup Github account and upload website

To upload your website into the github account you need to learn git. I am not covering the tutorial for using the git. You can refer to this site to learn git. Learn Git

Before starting, you need to know that you can only host the static webpages in the github. For example you can upload index.hml, javascript files and images. This means that you can’t host the CMS such as WordPress that is built on PHP. So, to sum up you can only host html, js, images and other files such as pdf.

First of all let us create a web site on Github. For this follow the steps below.

  1. Sign Up on Github, with username, email and password.

  2. Login to your Github Account

  3. Create new repository with the name username.github.io Here, don’t forget to change the username with your own github username that you used while signing up.

  4. This is the repository where you will upload your website.

  5. Have atleast index.html in this repository so, when you open username.github.io in your browser you will see your website running.

Step 2: Register your Domain Name

You can apply for new domain through the link below:

Register your free domain

To apply the domain name, you need to enter the following details in the above web site:

Domain name: yourname.com.np, just enter the domain name you want to register based on your name.

Name Server: Enter the name servers as follows.

Primary Name Server: eva.ns.cloudflare.com

Secondary Name Server: hank.ns.cloudflare.com

Since, we are using Github Pages to host our web site and Mercantile does not provide us to set up CNAME and A record for our domain.

You Details: Enter your Email and Personal details.

Documents: Scan and upload your citizenship document. Also write a cover letter mentioning that you want to register the domain.

After submitting all these information you will get an email confirmation from Mercantile Communications. If you do not get reply from them within a week just send them email to hostmaster@mercantile.com.np

Step 3: Point your domain to Github Pages through Cloudflare

Create a free account on Cloudflare. Sign up for Cloudflare

Add a site to Cloudflare. I am not writing each an every step. Refer to the following link.

Creating a Clouflare account and adding a Website

Next, after adding the site to Cloudflare, navigate to DNS tab and following record.

After adding all the records your settings will look something like this: Create A record for domain in Clouflare

Step 4: Create CNAME file in your Github repository

Till this step, we have point our domain to Githubpages and we have your website running in Github Pages with url username.github.io

Now, we need to update our domain name in Github.

In your repository in Github (created in the first Step) create a file name CNAME

In that file write the name of your domain (yourdomain.com.np) as shown in the image below.

CNAME file for Custom domain in GithubPages

Now, you when you open “yourname.com.np”, You will see you website running.

Note that it may take, upto 72 hours for the domain DNS to be updated throughout the web.