Reputation: 47018
If we want the custom domain example.com
with our github pages, then we just go into settings and add example.com
, and assuming that we have already added the A records for @
to our domain name registrar this just works IIUC.
Now if we also want a subdomain sub.example.com
for another github repository do we enter sub.example.com
in the repository settings panel for the custom domain? I assume this is all we have to do, assuming the A records for sub
have already been setup?
I've tried it out and post doing it I get this github message:
Your site's DNS settings are using a custom subdomain, sub.example.com, that's set up as an A record. We recommend you change this to a CNAME record pointing at [YOUR USERNAME].github.io. For more information, see https://help.github.com/articles/setting-up-a-custom-domain-with-github-pages/.
Why is github recommending this? There is a reference URL included in the message, but it's a link to generic instructions on how to setup github custom domains, and there's nothing specific with respect to sub domains.
Upvotes: 2
Views: 1890
Reputation: 16226
The message from GitHub is very clear, and according to its document:
You can set up a custom subdomain, such as blog.example.com, by creating a CNAME record through your DNS provider.
That is, you should use CNAME record, not A record, and point it to [YOUR USERNAME].github.io.
Upvotes: 1