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:
- Add a
CNAME
file to yourpublic
directory with your domain - Configure your DNS provider to point to your hosting service
- Update the
base
configuration if needed - 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:
- Add
CNAME
file with your domain name - Go to repository Settings > Pages
- Enter your custom domain
- 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:
- Go to Site Settings > Domain management
- Add custom domain
- Configure DNS records as instructed
- 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:
- Go to Project Settings > Domains
- Add your domain
- Configure DNS as shown
- 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