How to fix: Domain does not resolve to the GitHub Pages server. Error in Github Pages for custom domain setup with Enforce HTTPS Enabled?

For anyone stumbling across this. Actually I realized I have outlined the correct method to set this up with Github Pages. And this is in line with what is recommended by Github as of today and works perfectly well. Just make sure you wait for the DNS Propagation to take effect which in some cases might take up to 24hrs. And this is what the problem was in my case.


Github shown me sucessive error message. After several iterations, github is happy with the following :

  1. In Settings > Pages :set up your github page :
    (you will have some error-warning message and Enforce HTTPS won't be ticked at first) enter image description here

  2. On my github repository's root, a CNAME file with the website name (with www):

www.example.com
  1. On my domain registration's DNS :
www                     28800  CNAME  MYUSERNAME.github.io.
@                       21460  A      185.199.111.153
@                       21460  A      185.199.109.153
@                       21460  A      185.199.110.153
@                       21460  A      185.199.108.153
  1. WAIT A DAY, ENJOY OUTDOOR WALK.

  2. The website is ok and in my terminal, a dig command returns :

$dig WWW.example.com +nostats +nocomments +nocmd
;WWW.example.com.   IN  A
WWW.example.com.    26728 IN CNAME  MYUSERNAME.github.io.
MYUSERNAME.github.io.   1527    IN  A   185.199.108.153
MYUSERNAME.github.io.   1527    IN  A   185.199.111.153
MYUSERNAME.github.io.   1527    IN  A   185.199.110.153
MYUSERNAME.github.io.   1527    IN  A   185.199.109.153
  1. Tick the "Enforce HTTPS".

Note: Replace example.com and MYUSERNAME by the values relevant to you.