If you’ve built a portfolio or project site hosted on GitHub Pages and want to use a custom domain you purchased through Squarespace, you're in luck; this is absolutely doable and takes just a few steps.
This post will walk you through how to point your Squarespace-purchased domain to your GitHub Pages site, whether you're hosting on a user site (yourusername.github.io
) or a project site (yourusername.github.io/your-project
).
Prerequisites
Before we begin, you should have:
- A working site hosted on GitHub Pages
- A custom domain purchased via Squarespace (not a Squarespace-hosted website)
- Access to GitHub and Squarespace admin panels
Step 1: Determine Your GitHub Pages URL
You'll need your GitHub Pages URL, which will look like one of these:
For user or organization pages:
https://yourusername.github.io/
For project pages:
https://yourusername.github.io/project-name
Make sure your GitHub Pages site is already published and publicly viewable.
Step 2: Add a CNAME File
If you're using a custom domain, GitHub Pages needs to know about it.
- In your GitHub repository, create a file called CNAME (no extension).
- Inside it, write your custom domain (e.g. www.yourcustomdomain.com)
- Commit and push the file to your repo's default branch (usually main or master)
This tells GitHub Pages to expect traffic from that domain.
Step 3: Get Your GitHub Pages IP Addresses
Squarespace doesn’t support CNAME flattening or ALIAS records, so you’ll need to use A records pointing to GitHub’s static IPs.
As of this writing, GitHub Pages uses the following IPs:
185.199.108.153
185.199.109.153
185.199.110.153
185.199.111.153
GitHub recommends using all four A records for redundancy.
Step 4: Update DNS Settings in Squarespace
- Log in to Squarespace.
- Go to Domains and select the domain you purchased.
- Click DNS Settings.
- Add or update the following DNS records:
Type | Host | Value | TTL |
---|---|---|---|
A | @ | 185.199.108.153 | Default |
A | @ | 185.199.109.153 | Default |
A | @ | 185.199.110.153 | Default |
A | @ | 185.199.111.153 | Default |
CNAME | www | yourusername.github.io | Default |
This will:
- Point the root domain (yourcustomdomain.com) to GitHub Pages
- Point www.yourcustomdomain.com to GitHub via CNAME
⚠️ Note: Squarespace might already have default records— delete any existing A or CNAME records that conflict.
Step 5: Wait for DNS Propagation
DNS changes can take anywhere from a few minutes to 24–48 hours to fully propagate. You can use tools like whatsmydns.net to track progress.
Step 6: Verify the Setup
After DNS has propagated, go to your custom domain in a browser. You should see your GitHub Pages site served through your domain!
Troubleshooting Tips
- Getting a 404? Make sure your GitHub Pages is publishing from the correct branch.
- Still loading Squarespace? Clear DNS cache and check that the default Squarespace records were removed.
- Mixed content warnings? Make sure your GitHub site supports HTTPS (GitHub Pages offers this for free).
Conclusion
Connecting a Squarespace domain to your GitHub Pages site gives you the best of both worlds: a professional domain and free static hosting. With a few DNS tweaks and a CNAME file, your project will be live and looking sharp.
Happy coding!
Top comments (1)