Xinyu Wu

How to Add Custom Domain For Your Github Page

Step 1: Buy a custom domain you like.

You could use services like Godaddy.

setting

Step 2: Add DNS record for your custom domain

Add these 4 type A DNS record to point to github pages

setting

Then add this type CNAME DNS record to point to your github pages

setting

Then wait for the DNS to propagate. It could take from minutes up to 24 hours to propagate.

Step 3: Add custom domain in your Github Page repo

Go to settings and select Pages. Then type in your custom domain name and select Enforce HTTPS

setting

Summary

To add a custom domain to your github page is simple. You just need to

  1. Buy a custom domain
  2. Add DNS records for your custom domain
  3. Add the custom domain in your github page settings.

Enjoy your new website domain!