NameSilo + Cloudflare + Vercel 子域名配置总结
将在 NameSilo 购买的
xxx.top域名
配置子域名hopelaodou.xxx.top
并成功绑定到 Vercel 项目
一、整体架构说明
Section titled “一、整体架构说明”浏览器↓hopelaodou.xxx.top↓ DNSCloudflare(DNS / SSL / CDN)↓Vercel(前端项目托管)- NameSilo:域名注册商
- Cloudflare:DNS 托管
- Vercel:网站部署与 HTTPS
二、Step 1:将 NameSilo 域名接入 Cloudflare
Section titled “二、Step 1:将 NameSilo 域名接入 Cloudflare”1. 在 Cloudflare 添加站点
Section titled “1. 在 Cloudflare 添加站点”- 登录 Cloudflare
- 点击 Add a site
- 输入主域名(不要带子域名):
xxx.top- 选择 Free Plan
2. 获取 Cloudflare 的 NS 服务器
Section titled “2. 获取 Cloudflare 的 NS 服务器”Cloudflare 会提供两条 NS,例如:
lily.ns.cloudflare.commark.ns.cloudflare.com3. 在 NameSilo 修改 NS
Section titled “3. 在 NameSilo 修改 NS”- 登录 NameSilo
- Domain Manager → 选择
xxx.top - 点击 Change Nameservers
- 选择 Custom DNS
- 填入 Cloudflare 提供的两条 NS
- 保存
生效时间:几分钟 ~ 24 小时(通常 10 分钟内)
三、Step 2:在 Cloudflare 配置子域名 DNS
Section titled “三、Step 2:在 Cloudflare 配置子域名 DNS”进入 Cloudflare 控制台:
- DNS → Records → Add record
推荐配置(CNAME)
Section titled “推荐配置(CNAME)”| 类型 | 名称 | 内容 | Proxy |
|---|---|---|---|
| CNAME | hopelaodou | cname.vercel-dns.com | DNS only(灰云) |
⚠️ 重要:必须使用灰云(DNS only)
四、Step 3:在 Vercel 绑定子域名
Section titled “四、Step 3:在 Vercel 绑定子域名”- 登录 https://vercel.com
- 进入对应 Project
- Settings → Domains
- 添加域名:
hopelaodou.xxx.top- 等待状态变为 Valid
Vercel 会自动签发 HTTPS 证书
五、验证方式
Section titled “五、验证方式”ping hopelaodou.xxx.top或:
nslookup hopelaodou.xxx.tophttps://hopelaodou.xxx.top六、常见问题与坑位
Section titled “六、常见问题与坑位”❌ 1. Cloudflare 开启橙云代理
Section titled “❌ 1. Cloudflare 开启橙云代理”- 会导致 Vercel SSL 校验失败
- 必须设置为 DNS only(灰云)
❌ 2. 在 NameSilo 中添加 DNS 解析
Section titled “❌ 2. 在 NameSilo 中添加 DNS 解析”一旦使用 Cloudflare NS:
NameSilo 中的 DNS 解析 全部失效
👉 所有解析统一在 Cloudflare 管理
❌ 3. 使用 A 记录指向 Vercel IP
Section titled “❌ 3. 使用 A 记录指向 Vercel IP”Vercel 不支持固定 IP
✅ 正确方式:
CNAME → cname.vercel-dns.com七、扩展用法
Section titled “七、扩展用法”多子域名示例
Section titled “多子域名示例”www.xxx.topadmin.xxx.tophopelaodou.xxx.top全部按相同方式添加 CNAME 即可。
HTTPS 推荐配置
Section titled “HTTPS 推荐配置”- Cloudflare SSL:Full (Strict)
- Vercel:自动 HTTPS
八、最简流程速记版
Section titled “八、最简流程速记版”-
NameSilo → NS 改为 Cloudflare
-
Cloudflare → CNAME:
hopelaodou → cname.vercel-dns.com(灰云) -
Vercel → 添加域名:
hopelaodou.xxx.top