Skip to main content

DNS Management Guide

Best practices and patterns for managing DNS records with the Namecheap provider
2 min read

This guide covers DNS management strategies, best practices, and common patterns when using the Namecheap provider.

DNS Record Management Strategies#

OVERWRITE vs MERGE Mode#

The Namecheap provider supports two modes for managing DNS records:

OVERWRITE Mode (Recommended for Infrastructure as Code)

  • Replaces all existing records with those defined in your code
  • Provides full control and predictability
  • Any manual changes will be overwritten on next deployment

MERGE Mode (Use with Caution)

  • Adds or updates records without removing existing ones
  • Allows manual and automated management
  • Can lead to configuration drift

Common DNS Patterns#

Multi-Region Setup with Health Checking#

Configure DNS for a multi-region application:

Subdomain Delegation#

Delegate a subdomain to different nameservers:

Email Configuration#

Set up email with MX records and SPF:

CDN and Load Balancer Setup#

Configure DNS for CDN and load balancer:

Development and Staging Environments#

Organize DNS for multiple environments:

TTL Configuration Best Practices#

Choosing the Right TTL#

Use CaseRecommended TTLReason
Production (stable)3600-86400 (1-24 hours)Reduce DNS queries, improve performance
Pre-migration300-600 (5-10 minutes)Quick switchover during migration
Active deployment60-300 (1-5 minutes)Fast updates during changes
Development/Testing60 (1 minute)Rapid iteration

Security Best Practices#

CAA Records for Certificate Authority Authorization#

Wildcard Certificates#

DNS Verification and Testing#

Verification Commands#

After deploying DNS changes, verify with these commands:

DNS Propagation#

DNS changes can take time to propagate:

Common Issues and Solutions#

Issue: CNAME at Root Domain#

Problem: Cannot create CNAME record at root (@) domain

Solution: Use A record or ALIAS record instead

Issue: Conflicting Records#

Problem: Multiple records of different types for same hostname

Solution: Use different hostnames or consolidate records

Issue: Email Delivery Problems#

Problem: Emails not being delivered

Solution: Verify MX, SPF, DKIM, and DMARC records

Monitoring and Alerting#

DNS Health Checks#

Use Pulumi to create monitoring for DNS records:

Next Steps#