0
votes

I have a custom domain - example.com. I need to set it up such that the subdomain 'premium' (premium.example.com) points to github pages to a certain repository. but the apex domain (example.com) and the 'www' subdomain(www.example.com) points to some other server, maybe a wordpress based server.

I'm confused over these two aspects, on which one to set in my DNS spec:

  1. set the 'A' record in cPanel for 'premium.example.com' to point to github servers (185.199.108.153, 185.199.109.153, 185.199.110.153, 185.199.111.153).

  2. set the 'CNAME' record in cPanel for 'premium.example.com' to point to my github url (myuser.github.io).

could you please explain which of the two can be used to set up my subdomain? also what configuration to set for my apex and 'www' custom domains?

1

1 Answers

0
votes

It should be the CNAME record.

You can add a CNAME record and point premium to myuser.github.io. It's specified in the GitHub Pages document Also, you need to configure premium.example.com as the custom domain in the GitHub repository settings page(document).

CNAME is used to resolve your domain name to another one. According to Wikipedia:

A Canonical Name record (abbreviated as CNAME record) is a type of resource record in the Domain Name System (DNS) which maps one domain name (an alias) to another (the Canonical Name.)