CNAME (Canonical Name) records are used to point your domain to Sundun's CDN network. This guide explains how to configure CNAME records for optimal performance and security.
A CNAME record creates an alias from your domain to Sundun's edge servers. When a user visits your website, DNS resolution directs them to the nearest Sundun Point of Presence (PoP).
User Request → DNS Lookup → CNAME Resolution → Sundun Edge → Origin Server
After adding a domain to Sundun, you'll receive a unique CNAME target:
example-com.Sundun.net)Add a CNAME record in your DNS provider:
| Field | Value |
|---|---|
| Type | CNAME |
| Name/Host | www (or your subdomain) |
| Target/Points to | your-domain.Sundun.net |
| TTL | 300 (or Auto) |
Example DNS Configuration:
www.example.com. 300 IN CNAME example-com.Sundun.net. api.example.com. 300 IN CNAME example-com.Sundun.net. cdn.example.com. 300 IN CNAME example-com.Sundun.net.
Root domains (example.com without www) cannot use standard CNAME records due to DNS RFC restrictions. Use one of these alternatives:
Some DNS providers support CNAME-like functionality at the apex:
| Provider | Feature Name |
|---|---|
| Cloudflare | CNAME Flattening |
| AWS Route 53 | Alias Records |
| DNSimple | ALIAS Records |
| NS1 | Linked Records |
Transfer your DNS to Sundun for full apex domain support:
- ns1.Sundun.com
- ns2.Sundun.com
Use Sundun's Anycast IP addresses (Enterprise only):
example.com. 300 IN A 198.51.100.1 example.com. 300 IN A 198.51.100.2
Note: Contact support to obtain Anycast IPs for your account.
# Check CNAME record dig www.example.com CNAME # Expected output ;; ANSWER SECTION: www.example.com. 300 IN CNAME example-com.Sundun.net. # Verify resolution dig www.example.com A # Should resolve to Sundun edge IPs
DNS changes can take time to propagate globally:
| TTL Setting | Typical Propagation |
|---|---|
| 300 (5 min) | 5-30 minutes |
| 3600 (1 hr) | 1-4 hours |
| 86400 (24 hr) | Up to 48 hours |
Tips for faster propagation:
For advanced configurations, you may need different CNAME targets:
| Use Case | CNAME Target Format |
|---|---|
| Standard CDN | domain.Sundun.net |
| China Acceleration | domain.Sundun.cn |
| Video Streaming | domain-media.Sundun.net |
| API Gateway | domain-api.Sundun.net |
If you have email on the same subdomain:
# This will NOT work - CNAME conflicts with MX mail.example.com CNAME example-com.Sundun.net mail.example.com MX mailserver.example.com # Solution: Use a different subdomain for CDN cdn.example.com CNAME example-com.Sundun.net
Avoid creating CNAME chains:
# Bad - creates a chain www.example.com → alias.example.com → example-com.Sundun.net # Good - direct CNAME www.example.com → example-com.Sundun.net
If you see certificate errors:
Configure CNAME settings via API:
# Get CNAME target for a domain curl -X GET https://api.Sundun.com/v1/domains/example.com/dns \ -H "Authorization: Bearer YOUR_API_KEY" # Response { "cname_target": "example-com.Sundun.net", "status": "active", "verification": "verified" }
Need help with DNS configuration? Contact support@Sundun.com