heroku笔记 之 将自己的域名指向heroku应用

今天先记一下heroku的plugin里的custom domain names,也就是将自己的域名指向在heroku创建的app。

关键是两点:

1. 设置根域名的A记录

Root domains must use A records. Only your root domain (mydomain.com) may use A records.

To setup your root domain, add separate A records for each of the followingaddresses using your DNS management tool:

75.101.163.44
75.101.145.87
174.129.212.2

翻译过来就是为根域名(形如mydomain.com,而非www.mydomain.com)设置多条A记录。只有根域名才可以拥有多条A记录。

2. 将工作域名的cname(即别名)指向根域名,即设置 www.mydomain.com 的cname,使之指向 mydomain.com

接下来就是等待域名指向生效了。必要时可以使用 ipconfig /flushdns 命令来清除本机上的dns缓存,使之正确反映当前的最新状态。

原文地址:https://www.cnblogs.com/anjo/p/heroku_custom_domain.html