Skip to main content

How to Set Up Custom Domains

This guide shows you how to configure custom domains for your DocuMCP-deployed documentation site.

Quick Setup

# Prompt DocuMCP:
"set up custom domain for my documentation site"

Custom Domain Overview

DocuMCP supports custom domain configuration for professional documentation sites:

Domain Types

  • Subdomains: docs.yourcompany.com
  • Root Domains: yourcompany.com
  • Path-based: yourcompany.com/docs

Requirements

  • Domain ownership verification
  • DNS configuration access
  • GitHub Pages enabled
  • SSL certificate (automatic with GitHub Pages)

Setup Methods

# Complete domain setup:
"configure custom domain docs.example.com for my site"

This will:

  1. Guide you through DNS configuration
  2. Set up GitHub Pages custom domain
  3. Configure SSL certificate
  4. Test domain connectivity
  5. Set up redirects if needed

Method 2: Manual Configuration

Step 1: DNS Configuration

Add the following DNS records to your domain:

For Subdomain (docs.example.com):

Type: CNAME
Name: docs
Value: tosin2013.github.io

For Root Domain (example.com):

Type: A
Name: @
Value: 185.199.108.153
Value: 185.199.109.153
Value: 185.199.110.153
Value: 185.199.111.153

Step 2: GitHub Pages Configuration

  1. Go to your repository settings
  2. Navigate to "Pages" section
  3. Enter your custom domain
  4. Enable "Enforce HTTPS"

Step 3: Verification

# Verify domain setup:
"verify my custom domain configuration"

Domain Configuration Examples

Subdomain Setup

# Custom domain configuration
domain:
type: subdomain
name: "docs.example.com"
redirects:
- from: "example.com/docs"
to: "docs.example.com"

Root Domain Setup

# Root domain configuration
domain:
type: root
name: "example.com"
path: "/docs"
ssl: true

Advanced Configuration

Multiple Domains

# Set up multiple domains:
"configure domains docs.example.com and help.example.com"

Redirects

# Set up redirects:
"redirect old-domain.com to new-domain.com"

SSL Configuration

# Verify SSL setup:
"check SSL certificate for my domain"

Troubleshooting

Common Issues

Problem: Domain not resolving Solution: Check DNS propagation (up to 48 hours)

Problem: SSL certificate issues Solution: Verify GitHub Pages settings and DNS

Problem: Redirects not working Solution: Check CNAME vs A record configuration

Problem: Mixed content warnings Solution: Ensure all resources use HTTPS

DNS Troubleshooting

# Check DNS propagation:
dig docs.example.com
nslookup docs.example.com

# Test connectivity:
curl -I https://docs.example.com

Security Considerations

HTTPS Enforcement

  • Always enable HTTPS in GitHub Pages
  • Use HSTS headers for security
  • Monitor certificate expiration

Access Control

  • Configure appropriate permissions
  • Set up authentication if needed
  • Monitor access logs

Performance Optimization

CDN Configuration

# Optimize with CDN:
"set up CDN for my custom domain"

Caching Headers

# Cache configuration
caching:
static_assets: "1 year"
html_pages: "1 hour"
api_responses: "5 minutes"

Monitoring

Domain Health

# Monitor domain health:
"set up monitoring for my custom domain"

SSL Monitoring

# Monitor SSL certificate:
"monitor SSL certificate for my domain"

Best Practices

  1. Use Subdomains: Easier to manage than root domains
  2. Enable HTTPS: Essential for security and SEO
  3. Set Up Redirects: Maintain old URLs for SEO
  4. Monitor Uptime: Track domain availability
  5. Document Changes: Keep DNS records documented

Next Steps