Static sites on Github with a Custom Domain

I recently tried hosting a static site on Github with a custom domain. Github's docs on getting this done are unnecessarily confusing. Here's a quick snapshot of how to get this done quickly: I'm going to use the Github repo as an example. The custom domain is You can just change the values in the 2 bash variables below and execute the same sequence of steps.

Verify that everything worked by visiting your website published on Github:
eg. for the repo. If you have a different repo name, just use that along with your username: eg. http://${GITHUB_USER}${REPO_NAME}

Next, visit your domain's DNS registrar and add a DNS A record pointing to Github. The Github static IP addresses are detailed here: For reference, at the time I did my configuration, they were:


Make sure that you set up a DNS A record (probably in some Advanced Configuration section). Don't bother with any of the CNAME stuff (it's not useful). I can't really help much with this step since each registrar is different. Make sure you set up 4 A records: 2 for the root domain and 2 for the "www" subdomain (one for each of the IPs above).

Once everything is set up, wait for the DNS changes to propagate:
$ dig ${DOMAIN} +nostats +nocomments +nocmd

The output should look somewhat like:

$ dig +nostats +nocomments +nocmd
;    73  IN  A    73  IN  A

Hope that fixes things for you and gets you done sooner. Let me know if you face any issues in the comments.



Popular posts from this blog

AJAX और हिंदी

Coke Studio: Madari English Meaning and Lyrics

Sadi Gali - Punjabi Lyrics and Meaning (in English) - Tanu Weds Manu

Tune Meri Jaana Kabhi Nahin Jaana - Lonely (Emptiness) - IIT Guwahati - Rohan Rathore

Solved? LaTeX Error: pdf file is damaged - attempting to reconstruct xref table