5

I want www.username.github.io to redirect to username.github.io.

I have had a read through the documentation, and created a CNAME file to direct to www.username.github.io, but it is not working. (username.github.io is working)

I have ran a dig command to checkout the status (as advised in the documentation), and it is returning the simlar result for both www.username.github.io (not working) and username.github.io (working)

➜  ~  dig username.github.io  
; <<>> DiG 9.8.3-P1 <<>> username.github.io.
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2627
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;username.github.io.        IN  A

;; ANSWER SECTION:
username.github.io. 600 IN  CNAME   github.map.fastly.net.
github.map.fastly.net.  15  IN  A   185.31.18.133

And for www.usernam.github.io

➜  ~  dig www.username.github.io                        

; <<>> DiG 9.8.3-P1 <<>> www.username.github.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31996
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.username.github.io.    IN  A

;; ANSWER SECTION:
www.username.github.io. 600 IN  CNAME   github.map.fastly.net.
github.map.fastly.net.  19  IN  A   185.31.18.133

A difference I have noticed is www.username.github.io is returning

github.map.fastly.net.  19

But I don't know what this means.

Any help would be much appreciated!

Leo Ajc
  • 133
  • 1
  • 3
Rachel Black
  • 336
  • 2
  • 8

1 Answers1

1

The GitHub docs mention that you can configure your domain (both www or naked) to redirect to GitHub. The github.io domain is owned by GitHub, and as such, we can't control how they redirect webpages within their domain. And GitHub doesn't seem to support www.username.github.io (that URL 404s), so you can't point to that URL in the CNAME record.

Some more information in this answer.

The difference in output of dig command you pointed out 19 in the second case and 15 in the first is the TTL or Time To Live. It is used for network layer caching for routers to specify how much time each packet has to be cached for. More about it on Wikipedia

Community
  • 1
  • 1
Kashyap
  • 4,696
  • 24
  • 26