Chapagain's blog

Host .com.np domain for free

February 05, 2018 | 2 Minute Read

Today, we are going to learn how to host your personal .com.np site on free. For this purpose, we are going to use CloudFlare , githubpages and a .com.np domain.Before moving on you should have .com.np domain already registered. I assume that you have complete working knowledge of github. Lets roll now !!

Note: This trick works only for static pages.

Step1:

a) Go to your github account and create a repositroy named whatever you like.

b) Initialize the project on your local folder that you want to push on the github. Along with your folder contents, add a new file called CNAME and add your domain name in it. In my case I have added jeevanchapagain.com.np as my CNAME.

Reminder: CNAME has no any file extension and must be in uppercase.

c) Now push your files to the repo you just created before. Before pushing, switch no new branch

git branch gh-pages
git checkout gh-pages

We are switching on branch gh-pages as the static file can be hosted only on gh-pages.

Step 2:

a) Goto CloudFlare and signup using free plan.

b) Click on Add site at the top right,

laravel on heroku

c) Add your domain name and begin the scan.

laravel on heroku

d) Wait for some minute to complete the scan. Once the scan is completed click on Continue Setup.

e) We need to add two A records as we want our domain to point to github pages. Let’s get it done.

f) For first A record add your domain name in Name field and in IPV4 address field add 192.30.252.153.

g) For second A record do as the previous but in IPV address field add 192.30.252.154.

laravel on heroku

Don’t forget to add CNAME record to point your domain name with or without www to same location.

laravel on heroku

Click on Continue and choose a free plan.

If you followed the above process correctly, CloudFlare suggests you to update your nameserver with their nameserver.

To update the nameserver provided by CloudFlare go to MOS site and update it as told by cloduflare.

Once you have finished updating the nameserver on MOS site, return back to cloudflare and complete the rest of the process. It will take a while to complete the process.

By following this process, you can easily host your .com.np static site on Github-pages using cloudflare.