Hosting your website 🌐 with Github pages


March 6, 2021

Disclaimer: This may not just be the first blog post on this topic, yet we are not merely talking how to do it only but also why part which will delve a bit into some theoretical portions like DNS, webhosting etc.

I am discussing in this article how to host a self domain with GitHub:

Buy a domain name - I got mine from, while there are sites like google domains, hover, GoDaddy etc. My domain name cost about Rs 900+ after taxes like GST. If you are using a name with more than 5 characters a suffix like .com, .in etc. you will surely get a domain name in that price range. If the name is short, you may need to pay more and I have seen prices go up to Rs 6000 for a short domain name.


Create a repository with GitHub pages with the name: By default without a domain name, your default domain name is I used Beautiful Jekyll theme for building my blogging website. If you have a custom name, Enter your custom domain name in GitHub pages, and enforce HTTPS for our custom domain. Thanks to Lets Encrypt which is providing free SSL/TLS Certificates. This process will create a CNAME record in your repository.



Go to your DNS management system. In the bigrock, scroll all the way down in your domain name page, and reach the setting for DNS Management


Now on clicking Manage DNS create an A record, which is used to point to four name servers hosted by GitHub. First and foremost create a CNAME record that points your subdomain to the default domain for your site. For example, if you want to use the subdomain for your user site, create a CNAME record that points to


So what is a CNAME record?

The next step is to create an A record in the DNS management system. In docs for Configuring a custom domain for your GitHub Pages site - GitHub Docs, it’s mentioned the various IPs used for creating A records in DNS providing servicer.


What is A Record

Tada, your site is hosted like mine

Now to the theory portion. I also had hosted my domain earlier following the above steps more than once and it simply worked. Yet how it worked and why we needed black box was a big mystery to me, which I am trying to demystify with this article.

DNS is used to map a specific name into an associated IP address, an application program called library procedure called a resolver. Domain names were initially created specifically for solving the problem in ARPNET to understand which all nodes were there in the system. In those days they used a text file named hosts.txt to keep track of all hostnames and update every night. Yet as time progressed, things started changing for good, and the Domain name system was bought in place.

The domain name system consists of Top-level domain names which are managed by ICANN. The various top-level domains are classified into two types:

  1. Generic top-level domain names - which maps domains that are commonly used all over the world like .com, .net, .org etc. They can be used for any purpose, and the bost TLD by far is .com with more than 100+ million .com domains.

  2. Country-level domain names - which maps domain names based on the associated country names. Like our country India has .in, various government sites use domains based on it like

A domain name can be mapped to one or more associated servers. So even though when calling, it can be mapped to multiple servers in various locations of the world

Besides these top-level domain names, there are second-level domains which is the name which you want to assign for your individual domain name. Also,subdomains can be used to map domain names to certain specific or other sites by adding a word followed by a dot. For example, if you want to create a specific blogging website in my domain name - you can easily add:

Another interesting thing about domain names is they can only be in ASCII, even though with certain software some certain Unicode words can be used for domain names. The business of Domain name registries who are accredited with ICANN sell the various domain names and are responsible for providing basic functionalities like name server for our use case. Domain names are considered like real estates, the shorter and attractive it is. The more money it costs.

The domain name is a component of a uniform resource locator (URL) used to access web sites(this is a common question in computer networks theory class), for example: [4]

URL: Top-level domain: net Second-level domain: example Hostname: www

Resource Records are associated with a single host or top-level domain names. The real function of DNS is to map domain names into resource records. The resource records are five-tuple format as follows:

I know it is not a proper ending, just let me know in the comments if I have missed anything. It’s always to better to do something than doing nothing. That’s why I am continuing my weekly ramblings even though it’s not perfect

~ Kurian Benoy

📢 Resource alert I found this awesome cartoon comic which explains how DNS works


  1. Github docs
  2. how to host your website on GitHub pages-medium
  3. Computer Networks, Andrew S Tanenbaum
  4. Use in website hosting-Domain Name, Wikipedia