Static web publishing CLI tool for deploying web applications to a CDN with a single command
—
Comprehensive DNS management for custom domains, including zone management, record manipulation, and DNS configuration for Surge deployments.
View and manage DNS records for domains hosted on Surge.
/**
* View and manage DNS records for domain
* @param hooks - Optional lifecycle hooks
* @returns Command function
*/
function dns(hooks?: HookConfig): CommandFunction;CLI Usage:
# View DNS records for domain
surge dns example.com
# Add DNS record
surge dns example.com add A www 192.168.1.1
# Add CNAME record
surge dns example.com add CNAME api api.example.com
# Remove DNS record by ID
surge dns example.com rem 12345
# List all DNS operations
surge dns --helpSupported Record Types:
Library Usage:
surge.dns({})(process.argv.slice(2));Full DNS zone management and configuration.
/**
* Full DNS zone management for domain
* @param hooks - Optional lifecycle hooks
* @returns Command function
*/
function zone(hooks?: HookConfig): CommandFunction;CLI Usage:
# View complete DNS zone
surge zone example.com
# Zone management interface
surge zone example.com --editZone Management Features:
Library Usage:
surge.zone({})(process.argv.slice(2));A Records (IPv4):
# Point domain to IP address
surge dns example.com add A @ 192.168.1.1
# Point subdomain to IP
surge dns example.com add A www 192.168.1.1AAAA Records (IPv6):
# Point domain to IPv6 address
surge dns example.com add AAAA @ 2001:db8::1
# Point subdomain to IPv6
surge dns example.com add AAAA www 2001:db8::1CNAME Records:
# Point subdomain to another domain
surge dns example.com add CNAME api api.example.com
# Point subdomain to Surge
surge dns example.com add CNAME blog blog.example.surge.shMX Records (Mail):
# Add mail server
surge dns example.com add MX @ mail.example.com 10
# Add backup mail server
surge dns example.com add MX @ backup.example.com 20TXT Records:
# Add SPF record
surge dns example.com add TXT @ "v=spf1 include:_spf.google.com ~all"
# Add domain verification
surge dns example.com add TXT @ "verification-code-12345"
# Add DKIM record
surge dns example.com add TXT selector._domainkey "k=rsa; p=public-key-here"List All Records:
surge dns example.comRecord Display Format:
ID Type Name Value TTL Status
--- ---- ---- -------------------- ---- ------
001 A @ 192.168.1.1 300 Active
002 A www 192.168.1.1 300 Active
003 CNAME api api.example.com 300 Active
004 MX @ mail.example.com 10 300 Active
005 TXT @ "v=spf1..." 300 ActiveRemove by ID:
surge dns example.com rem 001Remove Multiple Records:
surge dns example.com rem 001 002 003Step 1: Configure DNS
# Point domain to Surge
surge dns example.com add CNAME @ example.surge.sh
# Or use A record if CNAME not supported for apex
surge dns example.com add A @ 45.55.110.124Step 2: Deploy to Domain
# Deploy project to custom domain
surge ./build example.comStep 3: Verify Configuration
# Check DNS propagation
dig example.com
# Verify HTTPS
curl -I https://example.comMultiple Subdomains:
# API subdomain
surge dns example.com add CNAME api api.example.surge.sh
# Blog subdomain
surge dns example.com add CNAME blog blog.example.surge.sh
# CDN subdomain
surge dns example.com add CNAME cdn cdn.example.surge.shGoogle Workspace:
# MX records for Gmail
surge dns example.com add MX @ aspmx.l.google.com 1
surge dns example.com add MX @ alt1.aspmx.l.google.com 5
surge dns example.com add MX @ alt2.aspmx.l.google.com 5
# SPF record
surge dns example.com add TXT @ "v=spf1 include:_spf.google.com ~all"Custom Mail Server:
# Primary mail server
surge dns example.com add MX @ mail.example.com 10
# Backup mail server
surge dns example.com add MX @ backup.example.com 20
# SPF record
surge dns example.com add TXT @ "v=spf1 mx ~all"Check Propagation Status:
# Check DNS propagation globally
dig @8.8.8.8 example.com
dig @1.1.1.1 example.com
# Check from multiple locations
nslookup example.com 8.8.8.8
nslookup example.com 1.1.1.1Propagation Timing:
Round Robin DNS:
# Multiple A records for load balancing
surge dns example.com add A @ 192.168.1.1
surge dns example.com add A @ 192.168.1.2
surge dns example.com add A @ 192.168.1.3Geographic Distribution:
# Different servers for different regions
surge dns example.com add A us 192.168.1.1
surge dns example.com add A eu 192.168.2.1
surge dns example.com add A asia 192.168.3.1CAA Records (Certificate Authority Authorization):
# Allow only specific CAs to issue certificates
surge dns example.com add CAA @ "0 issue letsencrypt.org"
surge dns example.com add CAA @ "0 issuewild letsencrypt.org"DMARC Policy:
# Email authentication policy
surge dns example.com add TXT _dmarc "v=DMARC1; p=reject; rua=mailto:dmarc@example.com"DNS Not Propagating:
Wrong IP Resolution:
Email Not Working:
Command Line Tools:
# Query DNS records
dig example.com
nslookup example.com
# Check MX records
dig MX example.com
# Check TXT records
dig TXT example.com
# Trace DNS resolution
dig +trace example.comOnline Tools:
Record Not Found:
Invalid Record Format:
Access Denied:
Install with Tessl CLI
npx tessl i tessl/npm-surge