https://<username>.github.io/<repo-name>. This guide walks through pointing your own domain (e.g. ourwedding.com) to that address.
Purchase a domain
Buy a domain from any registrar — Namecheap, GoDaddy, Google Domains, Cloudflare Registrar, etc. The registrar does not matter; you only need access to its DNS settings.
Enter your custom domain in GitHub Pages settings
In your GitHub repository, go to Settings → Pages.Under Custom domain, type your domain name (e.g.
ourwedding.com or www.ourwedding.com) and click Save.GitHub will commit a CNAME file to your repository automatically. The file contains a single line — your domain name.Verify the CNAME file
The You can also create or edit this file manually. There must be exactly one domain on the first line with no trailing path or protocol.
CNAME file at the root of your repo should contain only your domain:Add a CNAME DNS record (subdomain)
For a subdomain such as
Replace
www.ourwedding.com or wedding.ourwedding.com, log in to your registrar’s DNS management panel and add a CNAME record:| Type | Host | Value |
|---|---|---|
| CNAME | www | <username>.github.io |
<username> with your GitHub username.Add A records (apex / root domain)
For an apex domain such as
Many registrars also support
ourwedding.com (no www), CNAME records are not supported at the root. Add four A records pointing to GitHub Pages’ IP addresses instead:| Type | Host | Value |
|---|---|---|
| A | @ | 185.199.108.153 |
| A | @ | 185.199.109.153 |
| A | @ | 185.199.110.153 |
| A | @ | 185.199.111.153 |
ALIAS or ANAME records as an alternative for apex domains.DNS changes can take up to 48 hours to propagate globally. GitHub Pages may show a “Domain’s DNS record could not be retrieved” error during this period — this is normal. Check back after a few hours.
