How to add custom domain to your jekyll blog (provided that you built your site using github pages).

Matt Z
2 min readOct 13, 2018

If you are using github pages to set up your jekyll site, chances are github will provide you a default URL that looks something like this:


For example, I have a git-repo that is called: myblog, so the URL github assigned me is going to be:


So what should you do if you want to use your own domain instead of the default one?

Step 1: Configuring A records with your DNS provider

  1. Edit A records using your domain hosting site.

You should create A records that point your custom domain to the following IP addresses: original article


2. Add in one CNAME record for your custom domain. After everything is done it should looks something like this:

2. Create CNAME file in your github repo.

Under your github repo, click on create new file, name the file as CNAME. At the first line of the file, add in your custom domain name, for example, if my site’s domain name is:, then add that to the first line of the file then commit.

3. Edit your _config.yml file in your project folder.

Go to your site folder, open _config.yml delete the line: baseurl: and add your own domain under url, in the format of:

url: ""

Now if you refresh your github repo, under settings=>githubpages, you can see your site is published at Do notice that there might be a few minutes of delay before your site is successfully be linked to the domain, so be patient.

Follow me on Twitter, on GitHub and check out my website for more articles like this.