Skip to main content
Using a custom domain makes your wedding website more memorable and professional. Instead of username.github.io, your guests can visit yournames.com.

Prerequisites

  • Your website deployed on GitHub Pages
  • A domain name (you’ll need to purchase one if you don’t have it)

Domain Configuration Process

1

Purchase a Domain

You’ll need to buy a domain from a domain registrar:

Namecheap

Affordable pricing, easy to useStarting at $8-15/year

Google Domains

Simple interface, reliableStarting at $12/year

GoDaddy

Popular, many featuresStarting at $10-20/year

Cloudflare

At-cost pricing, includes CDNStarting at $8-10/year

Choosing a Domain Name

Popular formats for wedding websites:
  • firstnamewedsecondname.com (e.g., ankitawedsanil.com)
  • firstname-and-secondname.com
  • firstnamelastname.com
  • the-lastname-wedding.com
.com domains are most common, but .love, .wedding, or .events can be unique alternatives!
2

Create CNAME File

In your GitHub repository, create a file named CNAME (all caps, no extension) in the root directory.
ankitawedsanil.com
www.ankitawedsanil.com
This file tells GitHub Pages which custom domain(s) to use for your site.

Adding CNAME via Git

# Create CNAME file
echo "yourdomain.com" > CNAME
echo "www.yourdomain.com" >> CNAME

# Commit and push
git add CNAME
git commit -m "Add custom domain"
git push

Adding CNAME via GitHub Web

  1. Go to your repository on GitHub
  2. Click Add file > Create new file
  3. Name it CNAME
  4. Add your domain name(s), one per line
  5. Click Commit new file
Replace yourdomain.com with your actual domain name. Include both the root domain and www subdomain for flexibility.
3

Configure DNS Settings

Log in to your domain registrar and configure DNS records:

Add A Records

Point your root domain to GitHub Pages servers:
TypeNameValueTTL
A@185.199.108.1533600
A@185.199.109.1533600
A@185.199.110.1533600
A@185.199.111.1533600

Add CNAME Record

Point your www subdomain to your GitHub Pages URL:
TypeNameValueTTL
CNAMEwwwusername.github.io3600
DNS changes can take 24-48 hours to propagate fully, though they often work within a few hours.

Example: Namecheap DNS Settings

A Record    @      185.199.108.153
A Record    @      185.199.109.153
A Record    @      185.199.110.153
A Record    @      185.199.111.153
CNAME       www    username.github.io.
4

Update GitHub Pages Settings

  1. Go to your repository on GitHub
  2. Navigate to Settings > Pages
  3. Under Custom domain, enter your domain name
  4. Click Save
  5. Wait for DNS check to complete (green checkmark will appear)
  6. Enable Enforce HTTPS (recommended for security)
It may take a few minutes for GitHub to verify your DNS configuration. If it fails initially, wait an hour and try again as DNS records propagate.

Domain Configuration Examples

Example 1: Root Domain Only

If you want your site accessible at yourdomain.com:
yourdomain.com
For both yourdomain.com and www.yourdomain.com:
yourdomain.com
www.yourdomain.com

Example 3: Subdomain Only

For a subdomain like wedding.yourdomain.com:
wedding.yourdomain.com

Verification Steps

After configuration, verify your setup:
1

Check DNS Propagation

Use DNS Checker to see if your DNS records have propagated globally.
2

Test Domain Access

Try accessing your site using:
  • http://yourdomain.com
  • https://yourdomain.com
  • http://www.yourdomain.com
  • https://www.yourdomain.com
All should redirect to your GitHub Pages site.
3

Verify HTTPS

Ensure the padlock icon appears in your browser’s address bar, indicating a secure connection.

Troubleshooting

  • Verify DNS records are correct (use DNS Checker tool)
  • Ensure CNAME file exists in repository root
  • Check that GitHub Pages custom domain is saved in settings
  • Try removing and re-adding the custom domain in GitHub settings
  • Wait 24 hours after initial DNS configuration
  • Ensure DNS records are properly configured
  • Try unchecking and re-checking “Enforce HTTPS” in GitHub settings
  • Remove and re-add custom domain if issue persists
  • Verify CNAME record points to username.github.io
  • Ensure www is listed in your CNAME file
  • Check DNS propagation for www subdomain specifically
  • Wait for GitHub to issue SSL certificate (can take 24 hours)
  • Verify custom domain is properly saved in GitHub settings
  • Clear browser cache and try again

Best Practices

Use HTTPS

Always enable “Enforce HTTPS” for secure guest connections

Test Both Versions

Verify both root domain and www subdomain work correctly

Keep Records Updated

Save your DNS configuration for future reference

Monitor Expiration

Set reminders to renew your domain before it expires

Next Steps

Test Your Website

Thoroughly test your site before sharing with guests

GitHub Pages Guide

Learn more about deploying to GitHub Pages

Build docs developers (and LLMs) love