Connecting Namecheap Domain with GitHub Pages
Tags: hosting, github, domain, website
Published: 2019-06-09 04:34:40

---
title: Connecting Namecheap Domain with GitHub Pages
published: true
description: Learn how to connect a Namecheap domain to your GitHub Pages repository!
tags: Hosting, Github, Domain, Website
cover_image: https://i0.wp.com/rightfrombasics.com/wp-content/uploads/2018/11/github.jpg
canonical_url: https://rightfrombasics.com/posts/connecting-namecheap-domain-with-github-pages/
series: Hosting
---

A basic tutorial for those who are looking to connect their custom domain to GitHub Pages. This post assumes you will be getting your domain with Namecheap. But, it should mostly apply to any domain providers.

I first used Namecheap because they offered students free domains. Yup, if you are a student you can get a free Namecheap domain ending with `.me’ free for a year. Check their offer [here](https://nc.me/).

#### 1. Register on Namecheap
Simply go to the [Namecheap homepage](https://www.namecheap.com/) and register for an account.

#### 2. Select a cool domain
Try to get a `.com` domain. It is the most general and commonly used domain. But with a ton of websites floating online, you may not be able to find your ideal domain available under `.com`. If thats the case check out `.me` domains for a personal website (like mine), the trendy `.io` for a startup/business, `.net`. Namecheap offers a wide range of domains to choose from. Some of them are `.life`, `.co`, `.tech` etc.

Choose the domain carefully as you will be sticking with it for some considerable time.

#### 3. Get a GitHub Repository
If you have not yet created a repository, go to GitHub to create one. Name it `<your-github-username>.github.io` and ensure you have a master branch where you can push your HTML files. I assume you have your HTML, CSS, JavaScript files ready. Push them to this repository on the master branch.

Visit the website `<your-github-username>.github.io` should allow you to view the expected website.

#### 4. Create a CNAME record in your Repository
Create a file titled CNAME with your domain name. That’s it. For example my CNAME file contains this:
`harishv.me`.

#### 5. Go to Namecheap’s Dashboard
Under the Advanced DNS section, add in the following records. The CNAME record's value  follows the GitHub URL you made in step 3. The A records are used to point the domain name to the IP address of the hosting server, which in your case will be GitHub’s.

![Namecheap Records](https://i2.wp.com/rightfrombasics.com/wp-content/uploads/2018/12/Screenshot-2018-12-08-at-11.31.42-AM.png?w=1896&ssl=1)

That’s all folks. Give it a few minutes (or hours) and your site will be live at your newly registered domain.

### Looking for Hosting?
- If you want the best Wordpress hosting, I highly recommend [Bluehost](https://www.bluehost.com/track/harishv/). Get a great discount when you [apply through this link](https://www.bluehost.com/track/harishv/).
- Also, get a massive discount with [Hostinger](https://www.hostg.xyz/aff_c?offer_id=6&aff_id=2883) when you [apply through this link](https://www.hostg.xyz/aff_c?offer_id=6&aff_id=2883).

Both services offer great uptime and customer service. Oh did I mention - you get a free domain name with both Bluehost and Hostinger!