New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with CNAME and Dreamhost. #518

Closed
robotsandcake opened this Issue Apr 7, 2012 · 13 comments

Comments

Projects
None yet
5 participants
@robotsandcake

robotsandcake commented Apr 7, 2012

I'm having real problems using custom domains and Dreamhost, try as I might I can't get my blog to load when I plug my custom domain into my browser.

I have tried the following:

  • In my source directory on my local machine I have created a file called CNAME with the contents hackingcough.org which I have then committed and pushed up to Github.
  • And then went over to Dreamhost and created an A Record with hackingcough.org pointing to the IP address: 207.97.227.245
  • Then when I try to visit hackingcough.org all I see is the empty index of my web space at Dreamhost.

I followed the instructions at the bottom of this page on octopress, and then I tried the very similar method on the Pages help page. There has also been some googling, some swearing and some very serious beard pulling!

Can somebody help me, or point me in the right direction of the solution? Am I being incredibly dim and missing something obvious?

@lukearmstrong

This comment has been minimized.

Show comment
Hide comment
@lukearmstrong

lukearmstrong Apr 7, 2012

Contributor

Who your host is shouldn't matter, this appears to be a Github pages issue.

I assume you are pushing to hackingcough/hackingcough.github.com and want your Octopress site to be hosted on Github Pages, but accessible via your domain hackingcough.org

I do notice that your github pages site does appear to be working, in that if you go to http://hackingcough.github.com/ it redirects you to the domain set in your CNAME file. Which is what Github pages does when set up like this.

According to the very recently updated documentation at Github Pages, you need to point your A record to this IP address: 204.232.175.78

Strange, because my A record points to 207.97.227.245, but I did set my octopress site up awhile ago.

I've also setup a CNAME record to point www.lukearmstrong.co.uk to lukearmstrong.co.uk in case someone types my address into the browser including www.

Contributor

lukearmstrong commented Apr 7, 2012

Who your host is shouldn't matter, this appears to be a Github pages issue.

I assume you are pushing to hackingcough/hackingcough.github.com and want your Octopress site to be hosted on Github Pages, but accessible via your domain hackingcough.org

I do notice that your github pages site does appear to be working, in that if you go to http://hackingcough.github.com/ it redirects you to the domain set in your CNAME file. Which is what Github pages does when set up like this.

According to the very recently updated documentation at Github Pages, you need to point your A record to this IP address: 204.232.175.78

Strange, because my A record points to 207.97.227.245, but I did set my octopress site up awhile ago.

I've also setup a CNAME record to point www.lukearmstrong.co.uk to lukearmstrong.co.uk in case someone types my address into the browser including www.

@robotsandcake

This comment has been minimized.

Show comment
Hide comment
@robotsandcake

robotsandcake Apr 8, 2012

Okay, thanks for the reply; let me answer your questions:

  1. I am pushing to hackingcough/hackingcough.github.com but I had to check this because I was happily invoking rake generate and rake deploy and seeing the changes reflected on Pages. Such is my git experience!
  2. I'm seeing the same behaviour in that if I tried to visit my Pages URL it redirects me to hackingcough.org
  3. I have now changed the IP address in my A Record to reflect the new value, but as of yet I'm still seeing the same undesirable behaviour.
  4. As for the CNAME record in your last point, when I setup hosting I was able to choose an option so that no matter if you typed the URL with or without the www. You would still be directed to hackingcough.org. Do you think I should explicitly create a CNAME record for this purpose?

Again, thanks for your help!

robotsandcake commented Apr 8, 2012

Okay, thanks for the reply; let me answer your questions:

  1. I am pushing to hackingcough/hackingcough.github.com but I had to check this because I was happily invoking rake generate and rake deploy and seeing the changes reflected on Pages. Such is my git experience!
  2. I'm seeing the same behaviour in that if I tried to visit my Pages URL it redirects me to hackingcough.org
  3. I have now changed the IP address in my A Record to reflect the new value, but as of yet I'm still seeing the same undesirable behaviour.
  4. As for the CNAME record in your last point, when I setup hosting I was able to choose an option so that no matter if you typed the URL with or without the www. You would still be directed to hackingcough.org. Do you think I should explicitly create a CNAME record for this purpose?

Again, thanks for your help!

@lukearmstrong

This comment has been minimized.

Show comment
Hide comment
@lukearmstrong

lukearmstrong Apr 8, 2012

Contributor

1 - Ok

2 - Ok.

3 - I'm not sure why I didn't suggest this yesterday, if you change your hosts file you will see that the problem was the IP address the A record is pointed to.

I just added this to my /etc/hosts file (it'll be somewhere else if you are using Windows/Mac):

204.232.175.78    hackingcough.org

It will take awhile for your DNS to update to reflect the change you made to the A record, so using the hosts file is useful in cases like this to be able to do testing while you are waiting for the DNS changes to propagate.

4 - I think that option in your hosting is just for the virtual host settings, I doubt it will do anything other than create an A record for www.hackingcough.org to point to the IP address of the dreamhost server. I would explicitly create a CNAME record pointing www.hackingcough.org to hackingcough.org, that way even if you do decide to have hackingcough.org point somewhere else in the future, you won't need to make any more changes.

Contributor

lukearmstrong commented Apr 8, 2012

1 - Ok

2 - Ok.

3 - I'm not sure why I didn't suggest this yesterday, if you change your hosts file you will see that the problem was the IP address the A record is pointed to.

I just added this to my /etc/hosts file (it'll be somewhere else if you are using Windows/Mac):

204.232.175.78    hackingcough.org

It will take awhile for your DNS to update to reflect the change you made to the A record, so using the hosts file is useful in cases like this to be able to do testing while you are waiting for the DNS changes to propagate.

4 - I think that option in your hosting is just for the virtual host settings, I doubt it will do anything other than create an A record for www.hackingcough.org to point to the IP address of the dreamhost server. I would explicitly create a CNAME record pointing www.hackingcough.org to hackingcough.org, that way even if you do decide to have hackingcough.org point somewhere else in the future, you won't need to make any more changes.

@lukearmstrong

This comment has been minimized.

Show comment
Hide comment
@lukearmstrong

lukearmstrong Apr 8, 2012

Contributor

It appears your github repository has only had the master branch pushed to it.

See the documentation at this point: Don’t forget to commit the source for your blog.

This isn't required for the site to be hosted by Github pages, but you should regularly commit and push your source branch so that you can update your site from any computer by pulling your github repository.

Contributor

lukearmstrong commented Apr 8, 2012

It appears your github repository has only had the master branch pushed to it.

See the documentation at this point: Don’t forget to commit the source for your blog.

This isn't required for the site to be hosted by Github pages, but you should regularly commit and push your source branch so that you can update your site from any computer by pulling your github repository.

@Abizern

This comment has been minimized.

Show comment
Hide comment
@Abizern

Abizern Apr 8, 2012

I had the same problem with my DreamHost setup. It would keep bouncing back to the Dreamhost servers.

It turned out that I needed to set the hosting preferences for the domain to DNS Only. That fixed the problem.

Abizern commented Apr 8, 2012

I had the same problem with my DreamHost setup. It would keep bouncing back to the Dreamhost servers.

It turned out that I needed to set the hosting preferences for the domain to DNS Only. That fixed the problem.

@lukearmstrong

This comment has been minimized.

Show comment
Hide comment
@lukearmstrong

lukearmstrong Apr 8, 2012

Contributor

Ah, looks like @Abizern is correct, for some strange reason you appear to have two different IP addresses set up for the hackingcough.org A record.

luke@ft02:~$ dig hackingcough.org

; <<>> DiG 9.7.3 <<>> hackingcough.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50347
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;hackingcough.org.      IN  A

;; ANSWER SECTION:
hackingcough.org.   4610    IN  A   204.232.175.78
hackingcough.org.   4610    IN  A   173.236.227.49

;; Query time: 21 msec
;; SERVER: 87.194.255.154#53(87.194.255.154)
;; WHEN: Sun Apr  8 15:36:26 2012
;; MSG SIZE  rcvd: 66

luke@ft02:~$ dig www.hackingcough.org

; <<>> DiG 9.7.3 <<>> www.hackingcough.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13240
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.hackingcough.org.      IN  A

;; ANSWER SECTION:
www.hackingcough.org.   14400   IN  A   173.236.227.49

;; Query time: 163 msec
;; SERVER: 87.194.255.154#53(87.194.255.154)
;; WHEN: Sun Apr  8 15:36:29 2012
;; MSG SIZE  rcvd: 54
Contributor

lukearmstrong commented Apr 8, 2012

Ah, looks like @Abizern is correct, for some strange reason you appear to have two different IP addresses set up for the hackingcough.org A record.

luke@ft02:~$ dig hackingcough.org

; <<>> DiG 9.7.3 <<>> hackingcough.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50347
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;hackingcough.org.      IN  A

;; ANSWER SECTION:
hackingcough.org.   4610    IN  A   204.232.175.78
hackingcough.org.   4610    IN  A   173.236.227.49

;; Query time: 21 msec
;; SERVER: 87.194.255.154#53(87.194.255.154)
;; WHEN: Sun Apr  8 15:36:26 2012
;; MSG SIZE  rcvd: 66

luke@ft02:~$ dig www.hackingcough.org

; <<>> DiG 9.7.3 <<>> www.hackingcough.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13240
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.hackingcough.org.      IN  A

;; ANSWER SECTION:
www.hackingcough.org.   14400   IN  A   173.236.227.49

;; Query time: 163 msec
;; SERVER: 87.194.255.154#53(87.194.255.154)
;; WHEN: Sun Apr  8 15:36:29 2012
;; MSG SIZE  rcvd: 54
@robotsandcake

This comment has been minimized.

Show comment
Hide comment
@robotsandcake

robotsandcake Apr 8, 2012

@Abizern Thank you! I made the change and it immediately came up, he never would have thought of that.

@lukearmstrong thank you for your diagnostic help, I learnt a little something about A Records and I must completely glossed over that part in the documentation that told me to commit the source to the repository.

Thanks guys, but I have one more quick question so please bear with the newbie: now that you guys have answered my question, do I close the issue? I'm not entirely sure what the etiquette is.

robotsandcake commented Apr 8, 2012

@Abizern Thank you! I made the change and it immediately came up, he never would have thought of that.

@lukearmstrong thank you for your diagnostic help, I learnt a little something about A Records and I must completely glossed over that part in the documentation that told me to commit the source to the repository.

Thanks guys, but I have one more quick question so please bear with the newbie: now that you guys have answered my question, do I close the issue? I'm not entirely sure what the etiquette is.

@lukearmstrong

This comment has been minimized.

Show comment
Hide comment
@lukearmstrong

lukearmstrong Apr 8, 2012

Contributor

Just above the comment box, there is an button "Close issue".

I'm not sure if you have permission to do it, I don't, but I assume you do as you created the issue.

Contributor

lukearmstrong commented Apr 8, 2012

Just above the comment box, there is an button "Close issue".

I'm not sure if you have permission to do it, I don't, but I assume you do as you created the issue.

@Abizern

This comment has been minimized.

Show comment
Hide comment
@Abizern

Abizern Apr 8, 2012

@hackingcough I can see your site now, rather than than an empty directory listing!

Glad I could help.

Abizern commented Apr 8, 2012

@hackingcough I can see your site now, rather than than an empty directory listing!

Glad I could help.

@mjhea0

This comment has been minimized.

Show comment
Hide comment
@mjhea0

mjhea0 Dec 15, 2012

I am having a similar issue. I also use dream host.

Repo - mjhea0.github.com
Domain - mherman.org
CNAME - mherman.org

I created an A Record with mherman.org pointing to the IP address: 204.232.175.78
I also use dreamhost and set hosting preferences for the domain to DNS Only

Not sure what else to do. mherman.org goes to site temp unvailable, while www.mherman.org is just not found.

Any assistance would be appreciated - thanks!

mjhea0 commented Dec 15, 2012

I am having a similar issue. I also use dream host.

Repo - mjhea0.github.com
Domain - mherman.org
CNAME - mherman.org

I created an A Record with mherman.org pointing to the IP address: 204.232.175.78
I also use dreamhost and set hosting preferences for the domain to DNS Only

Not sure what else to do. mherman.org goes to site temp unvailable, while www.mherman.org is just not found.

Any assistance would be appreciated - thanks!

@mjhea0

This comment has been minimized.

Show comment
Hide comment
@mjhea0

mjhea0 Dec 15, 2012

Now mherman.org works but bit www.mherman.org

mjhea0 commented Dec 15, 2012

Now mherman.org works but bit www.mherman.org

@kitchen

This comment has been minimized.

Show comment
Hide comment
@kitchen

kitchen Dec 15, 2012

mherman.org has address 204.232.175.78
www.mherman.org is an alias for mherman.org.

I don't think github's CNAME support works with more than one domain name at a time. you can get www.mherman.org or mherman.org but not both.

If you set up www.mherman.org in dreamhost as a redirect to mherman.org, that should work, but that would require a hosting plan, I believe. It's been over a year since I worked there so I don't know for sure anymore :)

kitchen commented Dec 15, 2012

mherman.org has address 204.232.175.78
www.mherman.org is an alias for mherman.org.

I don't think github's CNAME support works with more than one domain name at a time. you can get www.mherman.org or mherman.org but not both.

If you set up www.mherman.org in dreamhost as a redirect to mherman.org, that should work, but that would require a hosting plan, I believe. It's been over a year since I worked there so I don't know for sure anymore :)

@kitchen

This comment has been minimized.

Show comment
Hide comment
@kitchen

kitchen Dec 15, 2012

also scratch this as I now see the discussion in #851, so we'll take it there!

kitchen commented Dec 15, 2012

also scratch this as I now see the discussion in #851, so we'll take it there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment