When I moved this site onto GitHub Pages, I still wanted it to live at chipsncode.com rather than under the usual github.io address. The slightly confusing part is that GitHub and Squarespace are doing two different jobs here: GitHub Pages hosts the site, while Squarespace manages the domain and its DNS.

There is nothing particularly exotic about connecting the two, but there are a couple of details worth getting right, particularly with an apex domain and GitHub’s domain verification. This is the configuration I ended up using for Chips’nCode.

Pointing the domain at GitHub

I started at the GitHub end. Under Settings → Pages for the repository, I set the custom domain to chipsncode.com. GitHub then knows which hostname the Pages site is supposed to answer for, but the domain still needs to be pointed towards GitHub through Squarespace.

For the apex domain, GitHub publishes four IPv4 and four IPv6 addresses. I added all of those in Squarespace, then used a CNAME to send www.chipsncode.com to the GitHub Pages hostname.

TypeHostValue
A@185.199.108.153
A@185.199.109.153
A@185.199.110.153
A@185.199.111.153
AAAA@2606:50c0:8000::153
AAAA@2606:50c0:8001::153
AAAA@2606:50c0:8002::153
AAAA@2606:50c0:8003::153
CNAMEwwwmarzogh.github.io

GitHub maintains the canonical DNS records in its Pages documentation, so I’d check those before copying the addresses above into a new setup. They are the values I used, but GitHub’s documentation is the sensible place to confirm that they are still current. Squarespace also documents how to add A, AAAA and CNAME records for web hosting.

Checking what DNS is actually doing

Once the records were in Squarespace, there was not much value in repeatedly refreshing GitHub and hoping everything had propagated. I found it more useful to ask DNS directly:

dig chipsncode.com +noall +answer -t A
dig chipsncode.com +noall +answer -t AAAA
dig www.chipsncode.com +noall +answer -t CNAME

That makes it fairly easy to see when the new records are actually being returned. GitHub notes that DNS changes can take up to 24 hours to propagate, although how long you really wait depends on the TTL and whatever has already been cached.

If your DNS provider lets you lower the TTL before making a change, something like 300 seconds can make this sort of work a little less tedious. It only helps if you do it before the old records are cached, though. Lowering the TTL after the change does not magically recall copies of the previous record that are already sitting in caches elsewhere.

Verifying the domain with GitHub

GitHub also supports domain verification, which is worth doing because it proves that the domain belongs to your account rather than merely pointing at a Pages site. GitHub gives you a TXT record containing a verification token, which in my case used a host resembling this:

_github-pages-challenge-marzogh

The value itself is the token supplied by GitHub.

There is a small Squarespace wrinkle here that is easy to trip over. GitHub shows the complete DNS name for the verification record, but Squarespace wants only the host label. For chipsncode.com, I entered _github-pages-challenge-marzogh, not _github-pages-challenge-marzogh.chipsncode.com, because Squarespace appends the domain name itself. Squarespace’s TXT record guide shows where that value belongs in its DNS interface.

Once that was saved, I could check the TXT record directly rather than waiting for GitHub’s interface to decide it was ready:

dig _github-pages-challenge-marzogh.chipsncode.com +nostats +nocomments +nocmd TXT

When the token appears in that response, the DNS side of the verification is doing what it should. GitHub can then verify the domain against that record.

Getting HTTPS to settle

The final part was mostly waiting. Once GitHub could see the correct DNS configuration and the domain verification had settled, Pages could issue the certificate and Enforce HTTPS became available.

There was nothing else I needed to configure at Squarespace for the certificate itself. At that point Squarespace was simply answering DNS queries with the records I had given it, while GitHub Pages was handling the site and its HTTPS certificate.

So, despite involving two different services, the setup is fairly uncomplicated once the division of responsibility is clear. Squarespace tells the internet where chipsncode.com should go, and GitHub takes over from there.