iTranslated by AI
How to Set Up a Custom Domain for GitHub Pages with Squarespace
First draft: 2025-12-28
Hiroyuki Komatsu (@komatsuh:bsky, @komatsuh:twitter)
I created a site called charcode.dev.
It is a tool for checking and manipulating the character codes that compose a string. The source code is available on GitHub.
Since I was at it, I decided to acquire the charcode.dev domain for the web app I'm hosting on GitHub Pages and operate GitHub Pages using that custom domain.
This article is a note on the configuration methods that were necessary at that time.
Steps
- Publish on GitHub Pages
- Acquire a custom domain
- Configure the DNS server settings
- Configure the GitHub Pages settings
1. Publish on GitHub Pages
I will publish the index.html located in the root directory of the GitHub repository. Since it is a simple web app, I will use a simple configuration.
- Go to Settings > Pages
- Select "Deploy from a branch" under Build and deployment > Source
- Select "master, / (root)" under Build and deployment > Branch
For newly created repositories, select "main" instead of "master".

With this, it will be published at the URL https:// <username> .github.io/ <repository name> / index.html.
In this case, the URL is https://hiroyuki-komatsu.github.io/charcode/index.html.
2. Acquire a custom domain
I acquired a custom domain using Squarespace.
3. Configure the DNS server settings
Change the Squarespace settings so that the acquired domain points to the page on GitHub Pages.
- Add the following under Domains > DNS > Custom records
| Host | Type | Data |
|---|---|---|
| @ | ALIAS | <username>.github.io |
| www | CNAME | <username>.github.io |

There is a setting called "Domain forwarding" on the website, but it was not necessary for this purpose.

4. Configure the GitHub Pages settings
- Go to Settings > Pages
- Set the custom domain in Custom domain (charcode.dev in this case)
- Check "Enforce HTTPS"

If configured correctly, the label "DNS check successful" will be displayed.
Summary
GitHub Pages makes it easy to publish web apps. Using a custom domain has further improved convenience.
charcode.dev is useful for checking and editing character codes, so please give it a try.
Discussion