Which entry for subdomain CNAME for Github Pages


#1

I want to set up an apex domain and www subdomain for Gitub-Pages. Setting up the apex Domain was easy. My DNS provider does not support ALIAS or ANAME records so I used the A record.

When i now configure a CNAME record with my DNS provider, what address should I use for a project page (not personal or organization page)?

YOUR-GITHUB-USERNAME.github.io

or

YOUR-GITHUB-USERNAME.github.io/YOUR-REPO

See point 3 = https://help.github.com/articles/setting-up-a-www-subdomain/


#2

You always point your domains at YOUR-GITHUB-USERNAME.github.io when using a CNAME record. No /YOUR-REPO.


#3

Also, don’t forget to create a file named CNAME to repository, which should contain Your (sub)domain name.


#4

Perfect Thanks! So I create a CNAME with two URLs?

Example for CNAME

foo.com
www.foo.com


#5

No, your CNAME file should only be www.foo.com. It’s actually preferred to use the Settings page for your repo to set your custom domain.