Blogging with Jekyll on Github : Setting Up Custom Domains

Over the past week, I have been attempting to set up my Jekyll blog to be configured correctly. While it is a bit meta to be blogging about how I got my blog set up, there are a couple caveats in Jekyll worth mentioning for anyone who is attempting to create or set up a Jekyll blog via Github pages.

For the most part, blogging with Jekyll on Github is very straight forward. This is even more true with resources like Jekyll Now which allow first time Jekyll-Github users to set up their blogs in under 10 minutes. For more advanced users, it boasts a detailed and clearly written README to help navigate through the initial hurdle of setting up, allowing you to focus on customization and content delivery. However, things start to go haywire once we attempt to configure Jekyll to work with subdomains or Github project pages.

Configuring for an apex domain

This is, perhaps, the most straight forward. Let’s say you have an apex domain like

GitHub: Add a CNAME file to your GitHub repository.

DNS Provider: Add either a) an A record that points to the following IP addresses:


or b) an ALIAS record that points to

Configuring for a subdomain

Like the former configuration, you will need to first add a CNAME file to your repository. The contents will be the subdomain url. For example, ‘’ or ‘’.

NOTE: If you configure to have a CNAME for your apex domain (, the ‘www’ subdomain will also redirect properly to

DNS Provider: Add a CNAME record that points to

Configuring project pages for an apex domain

Configuring project pages for an apex domain works similarly to configuring for an apex domain. Remember that the gh-pages branch is served as the webpage, whereas the rest of the branches are left untouched. So everything you do must be committed to the gh-pages branch.

Configuring project pages for a subdomain

Like configuring for a subdomain, you will need to add a CNAME record on your GitHub repository and on your DNS provider. If you previously had your baseurl property set to the repository name such as blog/, make sure you change the baseurl to the new subdomain URL that you plan to use. Otherwise, your content will not serve correctly.


  • DNS settings take a while to propagate, you can check to see if they are pointing at the desired IP addresses by using the dig command (dig

  • Project pages are served from the gh-pages branches, so make sure all your project website pages are commited to the gh-pages branch

Happy blogging!


Welcome to my technical blog. Over the years, I’ve amassed more notes in my Moleskines than are ever truly comprehendible a month, let alone a year later. At the encouragement of a few friends and former classmates, I am starting a blog in hopes to organize a bit of what I’ve learned whilst coding, in whatever shape or form it may be.

Whether you have stumbled upon this blog by random chance or are looking for some more information in relation to some of the projects I have done, I hope that something here will help you. If you are here because of the latter reason, feel free to reach out to me if any of what I have written does not make sense, or if there are additional comments or corrections you may have. Happy browsing!