Code4Newark / codefornewark.org

New Jekyll site for Code for Newark based on Open Savannah brigade site
https://codefornewark.org
MIT License
1 stars 8 forks source link

www.codefornewark.org goes to gandi domain site #28

Closed davidruffner closed 6 years ago

davidruffner commented 6 years ago

It should be redirected to codefornewark.org

davidruffner commented 6 years ago

It's a little complicated how Github pages works when you have a custom domain. I'll summarize my research so far, and describe what I have done.

Sources:

Summary

We need to use redirection to have a custom domain work with Github Pages. When I go to www.codefornewark.org or codefornewark.org, this should send a request to the Gandi.net DNS, which then redirects the request to the Github Pages servers. To make this redirection, we need to specify ANAME and CNAME records on Gandi.net, and a CNAME record in the Github Pages project.

The above articles describe how to set up the records, but the first also describes how you can use curl to test your configuration. Github Pages wants a request of the form:

curl --header "Host: codefornewark.org" http://192.30.252.153/

or

curl --header "Host: codefornewark.org" code4newark.github.io

Essentially, this command is asking for a webpage from the Github Pages server (Either with the static IP http://192.30.252.153/ or the URL code4newark.github.io). The Github pages server can give it the right page by using the information in the header and matching it to the CNAME in our Github repo.

What I have done so far

I followed the guides above to set the ANAME and CNAME records for our Gandi.net domain name as follows:

@ 10800 IN A 192.30.252.153
@ 10800 IN A 192.30.252.154
www 10800 IN CNAME code4newark.github.io.

The ANAME records point the apex, codefornewark.org, requests to the Github Pages servers static ip addresses. The CNAME points the www subdomain to the codefornewark Github Pages server.

Finally, I am waiting for the changes to propagate. According to the second article I can monitor the changes with:

dig www.codefornewark.org +nostats +nocomments +nocmd

Nothing yet...

davidruffner commented 6 years ago

It propagated! Closing this issue.