Configuring custom domain with NameCheap and configuring GitHub Pages for Custom Domain
1. Buy domain
2. Head to Domain list click Manage:
3. Head to Advanced DNS
4. Add A Name records:
- The format for the A name records should be as follows:
Type | Host | Value | TTL |
---|---|---|---|
A Record | @ | 185.199.108.153 | Automatic |
- Add 4 ‘A name’ records, one for each of the following IPv4 addresses allocated by GitHub Ref.
185.199.108.153 185.199.109.153 185.199.110.153 185.199.111.153
- Add 4 ‘A name’ records, one for each of the following IPv6 addresses allocated by GitHub Ref.
2606:50c0:8000::153
2606:50c0:8001::153
2606:50c0:8002::153
2606:50c0:8003::153
5. Add a ‘CNAME’ record for your GitHub Pages Repo:
- You can find your repo name at the top:
- Use the following format for your CNAME record
Type | Host | Value | TTL |
---|---|---|---|
CNAME Record | www | GOadn4p.github.io. | Automatic |
8. Confirm your final results looks like the following:
10. Test with the Dig command
- A Records
dig <Your-Domain> +noall +answer -t A
- AAAA Records
dig <Your-Domain> +noall +answer -t AAAA
11. Head to your git hub repo and select settings.
12. Navigate to Pages in the sidebar.
13. Configure the Custom Domain Section to contain your new domain.
14. Allow it to do the DNS check (Give it a while this does fail a few times due to how long it takes).
15. Once this is complete you can verify the record has been made by navigating to your repo root directory, there should be a new file named CNAME
16. Opening this you should see your domain.
17. Browse to your new domain you should now see your GitHub Pages.
ref
- https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-an-apex-domain
- https://www.youtube.com/watch?v=dbgEWWBvIxY