published 2020-07-20
GitLab pages is a great free website hosting service:
When you set up your GitLab pages website, GitLab wants you to verify that you own your domain. That's reasonable. However, it's necessary to translate GitLab's instructions into what is needed at NameCheap.
GitLab needs two DNS records:
A CNAME record that points from your domain to YourAccountName.gitlab.io.
Here's GitLab's template for my site:
seanharrison.org CNAME seanharrison.gitlab.io.
A TXT record with the domain verification code. Here's GitLab's template for my site:
_gitlab-pages-verification-code.seanharrison.org TXT gitlab-pages-verification-code=********************************
When converting these to DNS records at NameCheap, the key thing is remember that in NameCheap DNS, the Host
field should be the subdomain alone. So, in my case, I omit the root domain name (seanharrison.org
) from the DNS record Host
entries. Here's what it looks like on the "Advanced DNS" for seanharrison.org:
Type | Host | Value | TTL |
---|---|---|---|
CNAME Record | @ | seanharrison.gitlab.io. | 1 min |
TXT Record | _gitlab-pages-verification-code | gitlab-pages-verification-code=******************************** | 1 min |
Host
= @
, which means the root of the site. Host
= _gitlab-pages-verification-code
.Just remember that in NameCheap DNS, the Host is the subdomain alone. Once this is set up correctly, GitLab pages should be able verify your ownership of the domain and start the process of getting a LetsEncrypt SSL certificate in place. And you will be on your way to free static hosting with GitLab pages.