Custom Domain Setup
Ce contenu n’est pas encore disponible dans votre langue.
Setting up a custom domain for your Dockit documentation site helps establish your brand identity and provides a professional appearance. This guide covers the complete process of configuring custom domains across different hosting platforms.
Overview
A custom domain allows you to serve your documentation from your own branded URL instead of the default hosting provider subdomain. For example:
-
Default:
your-docs.netlify.apporyour-docs.vercel.app -
Custom:
docs.yourcompany.comorhelp.yourcompany.com
Prerequisites
Before setting up a custom domain, ensure you have:
-
Domain ownership: You own or control the domain you want to use
-
DNS access: Ability to modify DNS records for your domain
-
Deployed site: Your Dockit site is already deployed and working
-
SSL certificate: HTTPS support (usually provided automatically)
Domain Configuration Options
Subdomain Setup (Recommended)
Using a subdomain is the most common and recommended approach:
Root Domain Setup
You can also use your root domain, though this requires additional considerations:
Path-based Setup
Serve documentation from a specific path:
Platform-Specific Setup
Netlify Configuration
Step 1: Add Custom Domain in Netlify
-
Go to your site’s Site Settings in Netlify dashboard
-
Navigate to Domain management → Custom domains
-
Click Add custom domain
-
Enter your domain (e.g.,
docs.yourcompany.com)
Step 2: Configure DNS Records
Add a CNAME record in your DNS provider:
Step 3: Enable HTTPS
Netlify automatically provisions SSL certificates through Let’s Encrypt:
-
Wait for DNS propagation (up to 24 hours)
-
SSL certificate will be automatically issued
-
Force HTTPS redirect in Site Settings → HTTPS
Step 4: Configure _redirects (Optional)
Create a \_redirects file in your public/ directory:
Vercel Configuration
Step 1: Add Domain in Vercel
-
Go to your project dashboard
-
Navigate to Settings → Domains
-
Enter your custom domain
-
Choose the deployment branch
Step 2: Configure DNS
For subdomains, add a CNAME record:
For root domains, add A records:
Step 3: Verify Domain
Vercel will automatically verify your domain and issue SSL certificates.
Step 4: Configure vercel.json
GitHub Pages Configuration
Step 1: Configure Repository Settings
-
Go to repository Settings → Pages
-
Select source (usually
mainbranch) -
Add custom domain in the Custom domain field
Step 2: Create CNAME File
Create a CNAME file in your repository root or public/ directory:
Step 3: Configure DNS
Add a CNAME record pointing to GitHub Pages:
Step 4: Enable HTTPS
GitHub Pages automatically provides SSL certificates for custom domains.
Firebase Hosting Configuration
Step 1: Configure firebase.json
Step 2: Add Custom Domain
Add domain in Firebase Console:
-
Go to Hosting section
-
Click Add custom domain
-
Follow the verification steps
Step 3: DNS Configuration
Add the provided DNS records from Firebase Console.
DNS Provider Examples
Cloudflare DNS
Additional Cloudflare settings:
-
SSL/TLS: Full (strict)
-
Always Use HTTPS: On
-
Automatic HTTPS Rewrites: On
Google Domains
Namecheap DNS
Route 53 (AWS)
SSL Certificate Configuration
Automatic SSL (Recommended)
Most modern hosting platforms provide automatic SSL:
-
Netlify: Let’s Encrypt (automatic)
-
Vercel: Automatic SSL provisioning
-
GitHub Pages: Automatic for custom domains
-
Firebase: Google-managed certificates
Manual SSL Configuration
For advanced setups, you might need manual SSL configuration:
Advanced Configuration
Multiple Domains
Configure multiple domains for the same site:
Internationalization Domains
Set up different domains for different languages:
CDN Integration
Configure CDN for better performance:
Security Best Practices
HSTS Configuration
Enable HTTP Strict Transport Security:
Content Security Policy
Additional Security Headers
Performance Optimization
DNS Optimization
-
Use fast DNS providers: Cloudflare, Route 53, or Google DNS
-
Minimize DNS lookups: Reduce external resource dependencies
-
Enable DNS prefetching:
\<link rel="dns-prefetch" href="//example.com"\>
Caching Strategy
Monitoring and Analytics
Domain Health Monitoring
Set up monitoring for your custom domain:
Analytics Configuration
Troubleshooting
Common Issues
DNS Propagation Delays
DNS changes can take up to 48 hours to fully propagate worldwide:
Online tools:
SSL Certificate Issues
Common SSL problems and solutions:
-
Mixed content errors: Ensure all resources use HTTPS
-
Certificate mismatch: Verify domain names match certificate
-
Expired certificates: Set up auto-renewal
Redirect Loops
Prevent infinite redirects:
Performance Issues
Diagnose and fix performance problems:
Debug Tools
DNS Debugging
SSL Debugging
Migration Strategies
Zero-Downtime Migration
Plan for seamless domain migration:
-
Prepare new domain: Set up and test thoroughly
-
Update DNS with low TTL: Reduce propagation time
-
Monitor traffic: Watch for any issues
-
Implement redirects: Guide users to new domain
-
Update internal links: Change all references
-
Notify users: Communicate the change
Migration Checklist
-
Domain ownership verified
-
DNS records configured
-
SSL certificate active
-
Redirects implemented
-
Internal links updated
-
External references notified
-
Analytics tracking updated
-
SEO considerations addressed
-
Monitoring alerts configured
-
Rollback plan prepared
Best Practices
-
Choose meaningful subdomains: Use clear, descriptive names
-
Enable HTTPS everywhere: Never serve content over HTTP
-
Monitor domain health: Set up uptime monitoring
-
Plan for disasters: Have backup domains ready
-
Document your setup: Keep configuration records
-
Regular maintenance: Review and update configurations
-
Security first: Implement proper headers and policies
-
Performance matters: Optimize for speed and reliability
Conclusion
Setting up a custom domain for your Dockit documentation site enhances your brand presence and provides a professional experience for your users. Follow the platform-specific instructions, implement proper security measures, and monitor your domain’s health for the best results.
Remember to test thoroughly in a staging environment before making changes to production domains, and always have a rollback plan ready in case of issues.
