Create Free Websites on GitHub Pages
[website
GitHub
github-pages
DNS
]
GitHub Pages provides an effective way to host static web pages from GitHub repositories. You can link a custom domain to your GitHub page to create a professional site without a separate host. This guide explains how to set up a GitHub page and connect a GoDaddy domain.
Creating a GitHub Page
- Log into GitHub and create a public repo named
<username>.github.io
, using either your personal or organization’s GitHubusername
. - You can simply add a
index.hmtl
with any associated CSS files and you are ready to go. - The site will be live at
https://username.github.io
- GitHub supports static generator Jekyll to create some professional sites for free. See how to add a Jekyll theme to your site.
Adding a Custom Domain
- Purchase a domain (say
mydomain.com
) using a domain manager like GoDaddy. - In the Domain Dashboard select the domain you want to point to the GitHub Page.
- Edit the apex domain
A
record with the Name @ in it and edit the IP address to the following four IPs:
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
- You can check the DNS using a Linux bash shell using the command
dig
:dig mydomain.com +noall +answer -t A
-
Edit the
CNAME
(www
subdomain) record with the Typewww
and change the pointer to<username>.github.io
and Save it. - You can check the DNS again:
dig WWW.MYDOMAIN.COM +nostats +nocomments +nocmd
-
In the GitHub repo, navigate to
Settings -> Pages -> Custom domain
and add the purchased domain eg.www.mydomain.com
and Save it. - Allow for a little time for the DNS to propogate and now your custum domain (
www.mydomain.com
) should point to the GitHub Page (<username>.github.io
)