Skip to content

Domain FAQ

Questions about custom domains and DNS configuration.

Custom Domain Setup

Q: How do I add a custom domain to my VitePress site?

A: Steps to add a custom domain:

  1. Add a CNAME file to your public directory with your domain
  2. Configure your DNS provider to point to your hosting service
  3. Update the base configuration if needed
  4. Deploy your site

Q: What DNS records do I need?

A: For most hosting services:

  • CNAME record: Point your subdomain to the hosting service
  • A record: Point your root domain to the hosting service IP
  • AAAA record: For IPv6 support (optional)

GitHub Pages

Q: How do I use a custom domain with GitHub Pages?

A: Configuration steps:

  1. Add CNAME file with your domain name
  2. Go to repository Settings > Pages
  3. Enter your custom domain
  4. Enable "Enforce HTTPS"

Q: My custom domain shows 404 errors

A: Common solutions:

  • Wait for DNS propagation (up to 24 hours)
  • Check CNAME file content
  • Verify DNS configuration
  • Ensure repository is public or has GitHub Pro

Netlify

Q: How do I configure a custom domain on Netlify?

A: Steps:

  1. Go to Site Settings > Domain management
  2. Add custom domain
  3. Configure DNS records as instructed
  4. Enable HTTPS

Q: How do I set up domain redirects?

A: Create a _redirects file in your public directory:

# Redirect www to non-www
https://www.example.com/* https://example.com/:splat 301!

# Redirect old paths
/old-path /new-path 301

Vercel

Q: How do I add a domain to Vercel?

A: Process:

  1. Go to Project Settings > Domains
  2. Add your domain
  3. Configure DNS as shown
  4. Wait for verification

Q: Can I use multiple domains for one site?

A: Yes, you can add multiple domains and set one as primary.

DNS Configuration

Q: How long does DNS propagation take?

A: Typically:

  • A/AAAA records: 1-4 hours
  • CNAME records: 1-2 hours
  • Full global propagation: up to 48 hours

Q: How can I check if my DNS is configured correctly?

A: Use these tools:

  • dig command: dig yourdomain.com
  • Online DNS checkers
  • Browser developer tools
  • DNS propagation checkers

SSL/HTTPS

Q: How do I enable HTTPS for my custom domain?

A: Most hosting services provide automatic SSL:

  • GitHub Pages: Enable in repository settings
  • Netlify: Automatic with Let's Encrypt
  • Vercel: Automatic SSL provisioning

Q: My site shows SSL certificate errors

A: Solutions:

  • Wait for certificate provisioning
  • Check domain verification
  • Contact hosting support
  • Verify DNS configuration

VitePress Development Guide