According to offical tutorial, “You can only have one custom domain for any given set of Pages. If you want multiple domains to point to the same Pages, you will need to use a service that can redirect the other domains to your Pages domain.”
My personal feeling is that namecheap provides better user experience in managing your domains. You can get what you want very easily and their help page is indeed very helpful and can save you some time searching on the Internet. Name.com also has a nice-looking management interface, but it seems they don’t provide as many functionalities as namecheap does. I can get the redirection working without any pain but I failed to do the same thing on name.com. (I’m not a person who is familiar with web development nor network. If you are one, maybe you could ignore this comment.)
In this example, I use domainA(“rdu.im” from name.com) as the main method to access my github pages and use domainB(“rxdu.me” from namecheap) to do the redirection.
Add a CNAME file, which includes your primary domain name, to your github page repository
On namecheap: From the “Host Management” section on the left side, go to “All Host Records”. Add just one record:
- HOST NAME: @;
- IP ADDRESS/URL:http://rxdu.github.io;
- RECORD TYPE:redirect; TTL:1800
On name.com: Go to DNS Record and add two records:
- Type:A; Host:rdu.im; Answer:184.108.40.206; TTL:1800 -Type:A; Host:rdu.im; Answer:220.127.116.11; TTL:1800
After finishing the above 3 three steps, you should be all set. Wait for some time and check if both of the domains work properly.