- Регистрация
- 1 Мар 2015
- Сообщения
- 1,481
- Баллы
- 155
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:
You'll need your GitHub Pages URL, which will look like one of these:
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.
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
This will:
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 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
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!
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
- A custom domain purchased via Squarespace (not a Squarespace-hosted website)
- Access to GitHub and Squarespace admin panels
You'll need your GitHub Pages URL, which will look like one of these:
For user or organization pages:
For project pages:
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. )
- 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 to GitHub via CNAME
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 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).
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!