0

I would like to set up a github user page. I have created the repo and now I need to update my DNS records. I have the following DNS entries at the moment:

MX Records
mail.example.com

A Records
        123.45.67.89 (assume this is the default a record)
mail    123.45.67.89
www     123.45.67.89

CNAME
None

I would like my github page to be displayed at example.com. Do I update the www and default A records to the github IP and leave the mail pointing to the existing IP?

How do I redirect users that go to www.example.com to example.com?

xylar
  • 167
  • 8

3 Answers3

2

Yes, you can leave the mail IP as it is. You can delete the www record and set it as a CNAME to example.com. Then you change the "default" record to the GitHub IP as explained in the help page. GitHub will handle the redirect.

Christopher Perrin
  • 4,811
  • 19
  • 33
  • 1
    The help page you linked suggests setting the `www` record as a CNAME of `username.github.io`. There are good reasons for this. Mostly it gives GitHub control over the actual IP address in use without having to contact everyone with a custom domain and wait for them to change their A records. – Ladadadada Aug 07 '13 at 13:30
  • Sure it is reasonable but it depends if you want to use example.com or www.example.com. And that is a matter of tast. But I aggree. Using www as CNAME makes sense. – Christopher Perrin Aug 07 '13 at 13:43
1

Their documentation on this doesn't mention mail.

All you need to do is set the mail A-record to be where you need it to go. It won't hurt the rest.

According to their documentation, www => bare-domain redirects are not built in. To get this you'll have to handle the redirects in the page-content itself, if you can.

sysadmin1138
  • 133,124
  • 18
  • 176
  • 300
0

Assume that your github page domain is user.github.com , then set CNAME to user.github.com for www.example.com and point example.com to Ip address of github.com

Dont disturb your mail A record. If you want to redirect users that go to www.example.com to example.com then check https://stackoverflow.com/questions/12011521/redirect-www-example-com-to-example-com

clement
  • 955
  • 5
  • 9
  • You can't set `example.com` to be a CNAME, only subdomains can be CNAMEs. The domain root can only be an A record. There's a warning about this on [Github's custom domain help page](https://help.github.com/articles/setting-up-a-custom-domain-with-pages). Also, the CNAME should point to `user.github.io`. – Ladadadada Aug 07 '13 at 13:26
  • @Ladadadada Sorry. example.com should be a A record . subdomains like `www.example.com` should have CNAME to `user.github.com`. thats how my blog is setup. I checked your help link and now github says to add CNAME to `user.github.io` So it is better to go with it. Edited my answer. thanks :) – clement Aug 07 '13 at 17:32