Setting up a CNAME for your GitHub Pages does not require additional payment, but you need to have a private domain first. Here, we assume that we have already purchased a domain from Godaddy, so let’s go to the Godaddy DNS settings page to configure it.
- First, query GitHub’s IP address via Terminal:
dig {Your Domain}.github.io
dig xxxx.github.io
- Go to the Godaddy DNS page and set up 4
A Recordsand 1CNAME Record, please refer to the image.
- Add a
CNAMEfile withxxx.{Domain Name}to the private repo, ex.blog.xxx.com.
- Set up CNAME on the page and check the
Enforce HTTPSoption.
It might take some time to take effect. If everything is set up correctly, the DNS Check in step 4 should pass.
References