fun with DNS

or working through minor issues w/ publii/gh-pages/namecheap

namecheap needs DNS records which point to gh-pages' IP addresses.

This needs to be updated through Namecheap (in the domain 'control panel'), keeping in mind that they aren't hosting anything. That is left up to the user; options are to either:

  • maintain a physical server which will directly host the site
  • use a hosting service such as Wordpress (paid) or Github Pages/Gitlab Pages (free)

My setup: gh-pages is the name of my Github repository. When a change gets pushed to the master branch, a couple things happen behind the scenes:

  1. Github Pages builds the project
  2. Assuming a successful build, the site is then deployed to username.github.io/gh-pages
  3. Depending on the DNS configuration, hitting the thedeep3nd.io URL should show the updated site (basically a mirror of the other site).

CNAME files

CNAME is a top-level file in the parent directory that is used by Github Pages to handle custom domain names. Any change (modification, creation, deletion) to the Custom Domain field (in repo settings) will be treated as an actual commit to repo.

Another relevant fact: Github Pages limits you to one site per organization (username.github.io), but does not limit the number of project sites you're allowed to have, ie. username.github.io/myproject is also allowed, assuming that myproject is a gh-pages repo.

However, issues can appear when:

  • Two (or more) separate gh-pages repos have the same custom domain in their CNAMEs. This is easier to fix since its a github issue, whereas:
  • your DNS records (hosted by Namecheap) are broken because of either an incorrect A record (mapping your domain to the Github Pages IPs

In my haste to try out Publii, while I already had siddharth-agarwal.github.io being published from its own repo, my new repo now also had an identical CNAME.

Eventally I tracked down the issue: I had added a URL redirect (?) from siddharth-agarwal.github.iothedeep3nd.io manually in my Namecheap settings. So essentially, after a Publii commit to gh-pages, everything would break.

Once I deleted the CNAME record from Namecheap's DNS management system, everything started to work again.

> dig +noall +answer thedeep3nd.io
thedeep3nd.io.		1798	IN	A	185.199.111.153
thedeep3nd.io.		1798	IN	A	185.199.108.153
thedeep3nd.io.		1798	IN	A	185.199.110.153
thedeep3nd.io.		1798	IN	A	185.199.109.153

## after everything started working again ##

Strange issue.