Website security seems increasingly important these days, and have caused some users hesitated to visit a webpage without a trusted cert. To have such a site, owner needs to take care of Domain Name, Server Hosting and SSL certs in tradition,which is way too high for non-profit personal blogs. Is it possible to get them all in one for FREE?

The answer is Yes!, let me show you how to get them quickly.

Get Free Domain Name

There are multiple providers available on the market providing free Domain Name services. Considering you always get what you paid for, it may not be suitble for important services such as shopping. But if it’s just for a personal blog, I think it’s good enough, at least users won’t see my ugly gitlab/ name anymore.

The provider I’m using is called Freenom, they provide redirect services, and can customize DNS record or deligate request to External NS Servers.

log onto their webpage and create a new free Domain Name, it will trigger your new account created automatically. Because we’ll be using Cloudflare to provide us free SSL and would like to use it fully control the entire domain, so at leaset for now we don’t need any of their NS Servers serving us. Cloudflare NS are and

Create Gitlab/Github Page

Please refer to their official guide on how to create them.
Gitlab Guide
Github Guide

Redirect NS

In Gitlab, go to your project, Settings -> Pages and create a new Domain. Here we’d like to force users to always access our https site, so we need to add PEM certs and keys, which can be acquired from Cloudflare Crypto. We also need one more extra intermediate cert to trust Cloudflare, which is shown below:


Other things have to be done on Cloudflare side, we need to add TXT record to help Gitlab verify our ownership, and Domain Records too:

  1. If the domain has multiple uses (e.g., you host email on it as well):

    From DNS Record To A TXT gitlab-pages-verification-code=fdsfsdsdsdfds(autogen)
    you are good to go if you only want your entire site to be resolved as


    • Do not use a CNAME record if you want to point your to your GitLab Pages site. Use an A record instead.
    • Do not add any special chars after the default Pages domain. E.g., do not point your to or
    • GitLab Pages IP on has been changed from to in 2018
  2. It’s up to you to create CNAME record for www, I did it simply because Cloudflare complains if it can’t see www record.

  3. Change all relevant elements on your page to use new Domain Name, move http to https.

  4. Let DNS load and wait like 15 mins, go checkout your website, you should see new Cloudflare certs on your page and all functions act properly.

Note: The A name tells Cloudflare to redirect request from to Gitlab page IP, and the added TXT record helps identify which page it is inside Gitlab pages database, but this can’t be combined with existing gitlab page, e.g, if we already have a page, then we can’t reuse it for another site under it This will cause gitlab confused and keeps redirect traffic between this two pages.