So you have your dream domain, say my-domain.com, you also have a page on GitHub, say my-github.github.io/my-repo and you’d like to resolve my-domain.com to my-github.github.io/my-repo. How can this be done? Easy… just read on, it’s a 4 step process…
Step 1 – GitHub Pages Setup
- Login to GitHub
- Navigate to your Repository
- Go to Settings
- Scroll down to GitHub Pages section
- Fill in the Custom domain box with your domain my-domain.com
- Make sure the Enforce HTTPS box is checked
- Click Save
Step 2 – Your Domain Provider Setup
- Login to your Domain Provider
- Navigate to DNS Management section
- Create 4 A Records pointing to the following IP Addresses
- 185.199.108.153
- 185.199.109.153
- 185.199.110.153
- 185.199.111.153
- Save these DNS entries
Step 3 – Go back to GitHub
- Wait few moments, normally 5-10 minutes
- Go back to your Repository settings then GitHub Pages
- You should see green tick confirming your site is now published at your domain my-domain.com
- Make sure that Enforce HTTPS is also ticked
Step 4 – Browse to your Website hosted on GitHub Pages
- Simple, open browser and navigate to my-domain.com
- It’ll now resolve to you GitHub Page
If your GitHub Page is themed with Jekyll then you might also be interested in how to modify the theme. In order to do so please read my Custom Styling Jekyll Themes article explaining just that.
And if you need to link your Google Analytics with your Jekyll GitHub Pages then please read my article on Adding Google Analytics to Jekyll GitHub Pages.