Reputation: 9054
So I've followed the directions for setting up a custom domain with Github Pages. As per their recommendation, I'm attempting to set this up using a custom subdomain.
I purchased my domain through GoDaddy, and using their DNS Manager tool I added myappname.github.io under Host (CNAME):
I didn't change anything else, such as that IP address under A (Host).
Lastly, on my Github page when I go under settings it correctly says "Your site is published under www.myappname.com"
Yet, when I go to www.myappname.com, I see the following:
What did I do wrong?
Edit:
Output from dig:
dig www.myappname.co
; <<>> DiG 9.8.3-P1 <<>> www.myappname.co
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19874
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.myappname.co. IN A
;; ANSWER SECTION:
www.myappname.co. 3600 IN CNAME myappname.github.io.
myappname.github.io. 3600 IN CNAME github.map.fastly.net.
github.map.fastly.net. 18 IN A 199.27.76.133
;; Query time: 198 msec
;; SERVER: 10.2.0.4#53(10.2.0.4)
;; WHEN: Tue Mar 17 11:08:00 2015
;; MSG SIZE rcvd: 120
Upvotes: 1
Views: 923
Reputation: 136880
Your DNS is configured to redirect the www
subdomain to your GitHub Pages site, but your GitHub Pages CNAME
file specifies that your application should run on the apex domain, myappname.com
. This causes another redirection to the apex domain, which as you point out in your question has its own A
record pointing to a non-GitHub IP address.
As we discussed, one possible solution is to update the CNAME
file in your repository to use www.myappname.com
instead of myappname.com
and then set up a redirect from the apex domain to the www
subdomain.
This will cause requests to myappname.github.io
and myappname.com
to redirect to www.myappname.com
, where your site lives.
Upvotes: 2