Use a Squarespace domain with GitHub Pages

Emily DuBois
3 min readOct 3, 2018

--

Creating your website with a custom URL is momentous. Your first entrance into fashionable Internet society. A digital debutante ball. A modern promenade. Many of us haven’t staked a claim like this since joining the AIM community behind a clever screen name.

This tutorial will teach you how to publish your website directly from GitHub to a Squarespace domain. GitHub also has a Managing a custom domain for your GitHub Pages site document with helpful instructions.

Prerequisites

  1. A Squarespace domain. Search for and claim a domain here.
  2. A GitHub user site repository in the <user>.github.io format. If you do not already have one, follow this tutorial to set one up.

First, GitHub pages.

GitHub Pages is a static site hosting service that serves your custom website at a URL directly from a GitHub repository. Your user site repository automatically publishes updates to a URL of the same name, <user>.github.io. We need to enable the settings that allow an alternative domain to point to the content hosted in this repository.

  1. Navigate to your <user>.github.io repository in the GitHub web application, and select Settings from the navigation menu.
  2. Scroll down to the Code and automation > Pages section.
  3. Note the selected branch and folder in the Source section. GitHub will automatically publish any content committed to this branch in this directory to your website.
  4. In the Custom domain input, enter your Squarespace domain name. For example, I would input “www.emilymdubois.com” because I claimed www.emilymdubois.com.
  5. Ensure that Enforce HTTPS is selected. Note that it can take up to a day before this option is available.
  6. At the top of the page, select Code from the navigation menu.
  7. Select the branch from the drop-down menu you configured in the Code and automation > Pages > Source section.
  8. You should now see a file entitled CNAME containing your domain name.
GitHub Pages settings for a user.github.io repository published to a custom domain.
GitHub Pages settings for a user.github.io repository published to a custom domain.

Second, Squarespace.

Next, we need to point our custom domain’s DNS record to GitHub’s servers.

  1. Navigate to https://account.squarespace.com/domains.
  2. Find the domain name that you have configured your <user>.github.io repository to point to. Click on the preview in the first column, or select ⋮ > Manage Domain Settings in the last column.
  3. Click on the domain name in the left sidebar.
  4. Select DNS Settings from the sidebar navigation.
  5. Add an “A record with host “@” for each GitHub Pages IP address. Use the dig <user>.github.io command to get this list. At the time of authorship, they were 185.199.108.153, 185.199.110.153, 185.199.111.153, and 185.199.109.153.
  6. Add a “CNAME” record with host “www” to point your subdomain to <user>.github.io.
Squarespace custom records in the DNS settings.
Squarespace custom records in the DNS settings.

Third, patience.

It can take up to 24 hours for your new configuration to take effect. Don’t forget to select Enforce HTTPS in your GitHub Pages settings if you were previously unable to.

Once your changes have propagated, you should be able to navigate to your custom domain and see your <user>.github.io content. 🎉

www.emilymdubois.com pointing to content from emilymdubois.github.io.
www.emilymdubois.com pointing to content from emilymdubois.github.io.

--

--