Skip to content

Instantly share code, notes, and snippets.

@xiaomi7732
Last active March 4, 2022 00:10
Show Gist options
  • Select an option

  • Save xiaomi7732/ebc60425b8cc19ecde28d0564b0be6c9 to your computer and use it in GitHub Desktop.

Select an option

Save xiaomi7732/ebc60425b8cc19ecde28d0564b0be6c9 to your computer and use it in GitHub Desktop.
Enable GitHub Page for https://www.codewithsaar.net

Enable GitHub Page for https://www.codewithsaar.net

Last time, I posted about binding a custom domain of https://stack.codewithsaar.net to GitHub Page, (Read it here), noticing that is actually a subdomain(stack.abc.com). Ever since, I have turned on another GitHub page for my own - https://www.codewithsaar.net (and also https://codewithsaar.net) on an apex domain.

Since DNS is not my day to day job, it took me a couple of try and error to get it work. So, I am here to do a follow up.

Here's the final goal:

Of course, SSL enabled.

Proper DNS settings:

  1. Create a CName record like last time, notice the host name to be www, GitHub will do the redirect for www host:

    Type Host Value
    CNAME Record www xiaomi7732.github.io.
  2. Follow the GitHub documentation, created these A / AAAA records:

    Type Host Value Remark
    A Record @ 185.199.108.153 @ means the domain name, IP addresses are static ones by GitHub
    A Record @ 185.199.109.153
    A Record @ 185.199.110.153
    A Record @ 185.199.111.153
    AAAA Record @ 2606:50c0:8000::153
    AAAA Record @ 2606:50c0:8001::153
    AAAA Record @ 2606:50c0:8002::153
    AAAA Record @ 2606:50c0:8003::153

Bind to www subdomain

On GitHub Page settings, bind the page to sub-domain: www.codewithsaar.net.

image

And there you go! Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment