大网数据广告活动
网站运营与故障问答

Replacing A records with CNAME and limiting downtime

· 52CE 我爱测

I have a subdomain on domain.com and am using A records to point to some IP addresses associated with a github pages site. I am moving my hosting away from github pages to another provider. This provider suggests using a CNAME to…

问题原文

原帖链接 · jotamon · CC BY-SA 4.0

I have a subdomain on domain.com and am using A records to point to some IP addresses associated with a github pages site.

I am moving my hosting away from github pages to another provider. This provider suggests using a CNAME to configure the DNS.

In an effort to avoid downtime I am trying to find the best way to make the change.

Should I add the new CNAME and leave the A records in place? I could then delete the A records once the CNAME resolves.

Or should I add the new CNAME and delete the A records?

已采纳解答

原帖链接 · Maximillian Laumeister · CC BY-SA 4.0

A and CNAME records for the same subdomain will conflict with each other, so you'll have to remove the A record before adding the CNAME record. This should cause minimal downtime, though if the A record had a high TTL, then you may be waiting for a while before all clients update their DNS records and start hitting the new server instead of the old one. You can help minimize the switchover delay by lowering the TTL of the A record before migrating, then waiting out the duration of the original TTL before making your DNS changes.

An article from Rackspace describes this process of lowering the TTL before making changes:

Generally, we recommend a TTL of 24 hours (86,400 seconds). However, if you are planning to make DNS changes, you should lower the TTL to 5 minutes (300 seconds) at least 24 hours in advance of making the changes. After the changes are made, increase the TTL back to 24 hours.

Best practices for using TTL - Rackspace

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2023-12-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。