Skip to content

Custom Domain

Bind a custom domain to your Moire blog

By default, your website address is username.github.io/moire. By binding a custom domain, you can use a personalized address like blog.yourname.com.

  • Own a domain name (can be purchased from Namecheap, Cloudflare, etc.)
  • Ability to access your domain’s DNS settings

Moire supports two deployment platforms, and the method for binding a domain differs slightly between them.

  1. Go to your Forked repository.

  2. Click SettingsPages.

  3. Under Custom domain, enter your domain name:

    blog.yourname.com
  4. Click Save.

  5. Wait for the DNS check to complete (may take a few minutes).

  6. Check Enforce HTTPS (highly recommended).

Add DNS records at your domain provider’s side:

Using a Subdomain (Recommended):

TypeNameValue
CNAMEblogusername.github.io

Using a Root Domain:

TypeNameValue
A@185.199.108.153
A@185.199.109.153
A@185.199.110.153
A@185.199.111.153

DNS records usually take some time to take effect:

Time RangeDescription
5-10 minsFast providers (e.g., Cloudflare)
1-4 hoursMost providers
24-48 hoursWorst-case scenario

After binding your domain, you need to update the baseUrl in moire.config.ts:

export default {
title: "My Blog",
baseUrl: "https://blog.yourname.com", // Add this line
// ... other configs
}

Commit this change to GitHub and wait for the build to complete.

DNS propagated but site still inaccessible?

Section titled “DNS propagated but site still inaccessible?”
  • Check GitHub Pages / Vercel status.
  • Ensure DNS record types and values are exactly correct.
  • Clear your browser cache.
  • GitHub Pages: Ensure “Enforce HTTPS” is checked and wait for the certificate (up to 24 hours).
  • Vercel: Handled automatically; contact Vercel support if it fails.
  • Ensure you updated the baseUrl configuration.
  • Check if GitHub Actions built successfully.
  • Try accessing /index.html to confirm the file exists.

Managing your domain through Cloudflare provides:

  • ⚡ CDN acceleration
  • 🛡️ DDoS protection
  • 🔒 Free SSL
  • 📊 Traffic analytics

Setup steps:

  1. Add your domain to Cloudflare.
  2. Update your domain registrar’s Nameservers to Cloudflare’s.
  3. Add DNS records in Cloudflare.
  4. Enable Proxied (orange cloud icon).

If you want to redirect the old address to your new domain:

Add to vercel.json in Vercel:

{
"redirects": [
{
"source": "/:path*",
"destination": "https://blog.yourname.com/:path*",
"permanent": true
}
]
}

Encountering issues? Check the troubleshooting guide.