Understand CNAME records
The CNAME record creates an alias for your domain name that points to the Sundun edge server. When a user visits your website, DNS resolution directs them to the nearest Sudun access point.
用户请求 → DNS 查询 → CNAME 解析 → Sudun 边缘节点 → 源服务器
Once you add a domain name in Sudun, you get a unique CNAME target:
example-com.Sudun.comAdd a CNAME record to your DNS provider:
| field | value |
|---|---|
| Type | CNAME |
| Name/Host | www (or your subdomain) |
| Target/Direction | your-domain.Sudun.com |
| TTL | 300 (or automatic) |
DNS configuration example:
www.example.com. 300 IN CNAME example-com.Sudun.com. api.example.com. 300 IN CNAME example-com.Sudun.com. cdn.example.com. 300 IN CNAME example-com.Sudun.com.
The root domain name (example.com without www) cannot use a standard CNAME record due to DNS RFC restrictions. Please use one of the following alternatives:
Some DNS providers support CNAME-like functionality at vertex domain names:
| Providers | Feature name |
|---|---|
| Cloudflare | CNAME flattening |
| AWS Route 53 | Alias records |
| DNSimple | ALIAS records |
| NS1 | Link records |
Migrate your DNS to Sudun for full vertex domain support:
- ns1.Sudun.com
- ns2.Sudun.com
Using Sudun's anycast IP address (Enterprise only):
example.com. 300 IN A 198.51.100.1 example.com. 300 IN A 198.51.100.2
Note: Contact support to get the anycast IP for your account.
# 检查 CNAME 记录 dig www.example.com CNAME # 预期输出 ;; ANSWER SECTION: www.example.com. 300 IN CNAME example-com.Sudun.com. # 验证解析 dig www.example.com A # 应解析为 Sudun 边缘节点 IP
DNS changes can take time to propagate globally:
| TTL settings | Typical transmission time |
|---|---|
| 300 (5 minutes) | 5-30 minutes |
| 3600 (1 hour) | 1-4 hours |
| 86400 (24 hours) | Up to 48 hours |
Tips for accelerating dissemination:
For advanced configurations, you may need different CNAME targets:
| Usage scenarios | CNAME target format |
|---|---|
| Standard CDN | domain1.Sudun.com |
| China accelerates | domaincn.Sudun.com |
| Video streaming | domain-media.Sudun.com |
| API Gateway | domain-api.Sudun.com |
If you have configured mail services on the same subdomain:
# 这将无法工作 - CNAME 与 MX 冲突 mail.example.com CNAME example-com.Sudun.com mail.example.com MX mailserver.example.com # 解决方案:为 CDN 使用不同的子域名 cdn.example.com CNAME example-com.Sudun.com
Avoid creating CNAME chains:
# 错误示例 - 形成链式结构 www.example.com → alias.example.com → example-com.Sudun.com # 正确示例 - 直接 CNAME 指向 www.example.com → example-com.Sudun.com
If you encounter a certificate error:
Configure CNAME settings via API:
# 获取域名的 CNAME 目标地址 curl -X GET https://api.Sudun.com/v1/domains/example.com/dns \ -H "Authorization: Bearer YOUR_API_KEY" # 响应示例 { "cname_target": "example-com.Sudun.com", "status": "active", "verification": "verified" }
Need help configuring DNS? Please contact admin@jindun.com
Adding a domain name to Sudun CDN is the first step in speeding up and securing your website. This guide will walk you through the domain onboarding process.