It’s pretty simple to use a custom domain for your GitHub Page. Start by reading GitHub Pages Basics and then follow the directions.
Here’s what I did:
Update DNS in Route53
- Login to your Amazon Web Services Console
- Go to Route53
- Go to Hosted Zones
- Select the Domain Name and Go to Record Sets
- Select “Create Record Set”
- Add a CNAME Record from your desired custom name to your github page. In my case, I created a CNAME record named “github.ideoplex.com” and directed it to “ideoplex.github.io”.
Verify your DNS setting from the command line with dig:
~ 17 $ dig github.ideoplex.com
You want to see your custom domain name (github.ideoplex.com) aliased to your github user page (ideoplex.github.io) aliased to something (github.map.fastly.net) that references an ip address (18.104.22.168).
Add a CNAME record to your repository
The GitHub instructions to add a CNAME record are straight forward.
- Identify the correct branch.
- Use master for user and organization pages
- Use gh-pages for project pages
- Add a new file named CNAME (all caps) to the branch root directory
- Add a single line to the CNAME file that specifies the bare subdomain for your page (in my case, github.ideoplex.com)
Verify the CNAME behavior with curl:
~ 18 $ curl -I http://ideoplex.github.io/
This was the hardest part. The first two steps took a couple of minutes, but it can take ten minutes for the changes to take effect at GitHub.