Custom Domain to GitHub Pages (Hostinger Edition)
Go to your Hostinger domain DNS settings
The first step is to go to your Hostinger domain DNS settings. You can do this by visiting https://hpanel.hostinger.com/domain/yourdomain.com/dns.
Create two new CNAME records
We need to create two new CNAME records. The first record will point www.yourdomain.com
to <your-github-username>.github.io
. The second record will point yourdomain.com
to <your-github-username>.github.io
.
- Enter Type - CNAME, Name - www, Points to - .github.io, TTL you can leave as default. This is for when someone types
www.yourdomain.com
. - Then we need the same for APEX domains or when someone just types
yourdomain.com
, for this enter another CNAME with Name - @ and Points to .github.io. This will automatically set an ALIAS type and add it to the DNS records.
Add the GitHub Pages IP addresses
Finally, we need to add the IP addresses and the txt value(this is obtain in the github/gitlab itself) for GitHub Pages to our DNS records. Add A type, Name - @, TTL can be left as default records for each of the following IP addresses (should be copied and pasted into “Points to”)
Comments
Post a Comment