问题原文
原帖链接 · 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
