Custom GitHub Domain Settings
I am trying to set up GitHub to my bare domain.com
(APEX on GitHub) and www.domain.com
.
It username.github.io
works fine for me .
My A entry points to 192.30.252.153
and 192.30.252.154
.
Then I have two CNAME records:
-
www.domain.com
→domain.com
-
io.domain.com
→username.github.io
However, this configuration doesn't work.
Accessing domain.com
leads to 404 on GitHub. Meanwhile, access www.domain.com
leads to ERR_NAME_NOT_RESOLVED
.
The existing documentation is confusing and there is no clear way to configure things at the end.
Can someone tell me what I am missing?
source to share
Here's what I did to get domain.com and www.domain.com working, you need the following:
- A record for www
- A Record @ 192.30.252.153
- A Record @ 192.30.252.154
- CNAME aliasing www.domain.com to username .github.io. (note the end period)
- The CNAME file in the GitHub Pages repository contains the text "domain.com"
I think the wildcard A might be optional in your case, but I'm not sure.
Edit: Removed wildcard. Recording. @mheadroom noted that GitHub recommends against this post because it will allow anyone to host a GitHub Pages site on one of your subdomains! https://help.github.com/articles/tips-for-configuring-a-cname-record-with-your-dns-provider/
source to share
Based on Erik's answer , here's a slightly modified configuration that worked for me.
For my custom (apex) domain eyecatchup.rocks
, I have set:
- An
A record
: host@
, destination192.30.252.153
- An
A record
: host@
, destination192.30.252.154
- An
A record
: hostwww
, destination192.30.252.153
- An
A record
: hostwww
, destination192.30.252.154
- An
CNAME record
: hostwww
, destinationeyecatchup.github.io
The CNAME file in the GitHub Pages repository contains eyecatchup.rocks
.
With this set, both eyecatchup.rocks as well as www.eyecatchup.rocks point to my custom GitHub page originally available at eyecatchup.github.io .
source to share