I've registered an Apex domain (example.com) on GoDaddy. I'd like to link it to a project page (gh-pages branch).

My GoDaddy setup is as follows:

  • Two A records that point to Github IPs.
  • A CNAME record for www subdomain that points to my github pages URL (without the /project-name part).

My Github setup is:

  • A repository with a gh-pages branch (/project-name)
  • A CNAME file in this branch that points to example.com

After reading Github Pages docs and other answers on SO for an hour or so I'm still confused:

  • Will the site work both for example.com and www.example.com URLs?
  • Will I benefit from Github's CDN and DoS protection.

If not I'd really appreciate further advice or reference information.

My GoDaddy Setup

  • You should be able to do this, though I am not an expert, we have knowledgeable people on just that topic. Even then, I am sure we have answered this question before one way or another. This list should help: webmasters.stackexchange.com/search?q=godaddy+github
    – closetnoc
    Feb 15, 2017 at 22:00
  • @closetnoc Thanks, I've seen this info but there are no clear cut answers about the issues I brought up here.
    – krulik
    Feb 16, 2017 at 7:48
  • I am not sure about the second question, but yes to the first question. Why did you need two A records? Mar 2, 2017 at 23:28

1 Answer 1


Will the site work both for example.com and www.example.com URLs?

Yes it will work because you have setup both A records and CNAME records in your Godaddy account. Your current CNAME file in your github pages is this example.com hence it will redirect your www.example.com visors to example.com. If you have used www.example.com in CNAME(Github) file then it will redirect all visitor from example.com to www.example.com. Hope it will clear your doubt.

Will I benefit from Github's CDN and DoS protection.

Well your current setting points that, you're using apex domain. And github recommended to use www as CNAME, if you want to get benefits from their CDN. So no benefits if you've used apex or custom domain like(blog.example.com).

  • Thank you very much! So it means that if I want to benefit from Github's features I need to change the CNAME file in my Github repo to point to www.example.com instead of example.com? Is there anything else I need to do in the Godaddy account?
    – krulik
    May 20, 2017 at 18:54
  • No, just use www in CNAME, and everything will be fine.
    – Goyllo
    May 20, 2017 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.