0
votes

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):

enter image description here

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:

enter image description here

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
1
How long did you wait after changing your DNS settings? DNS changes take time to propagate. Also, you're not actually using myappname.github.io and www.myappname.com, right? You're using a real repository and domain?Chris
Changed it at around 12am today (so last night). And yes I'm using a real name hahaApollo
Could you try an IP lookup for www.myappname.com using dig on Linux or OSX, or nslookup on Windows and add the output to your question?Chris
@Chris yup, edited my questionApollo
1. If you visit www.myappname.com with dev tools enabled and look at the Server response header does it show GitHub.com? 2. What happens when you visit myappname.github.io directly? 3. Are you willing to link to the GitHub repository in question (I'm guessing not, since you've used myappname so consistently).Chris

1 Answers

1
votes

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.