Heroku Godaddy 裸域 [英] Heroku Godaddy naked domain

查看:26
本文介绍了Heroku Godaddy 裸域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Heroku 应用程序,并且我添加了一个 CNAME(www 到 herokuapp)以将它从 GoDaddy 重定向到 Heroku.现在我也在尝试管理裸域.

I have a Heroku app and I've add a CNAME (www to herokuapp) to redirect it from GoDaddy to Heroku. Now I'm trying to manage also the naked domain.

这是来自 Heroku 文档.

裸域(也称为裸域或顶级域,例如 mydomain.com)必须使用 DNS A 记录.要设置您的根域,请使用您的 DNS 管理工具为以下每个地址添加单独的 A 记录:

Naked domains (also known as bare domains or apex domains, for example mydomain.com) must use DNS A-records. To setup your root domain, add separate A records for each of the following addresses using your DNS management tool:

75.101.163.44
75.101.145.87
174.129.212.2

使用host"命令检查您的 DNS 配置是否正确:

Check that your DNS is configured correctly with the "host" command:

$ host example.com
example.com has address 75.101.163.44
example.com has address 75.101.145.87
example.com has address 174.129.212.2

我还从 GoDaddy 主菜单激活了转发.

I've also activated the forwarding from the GoDaddy main menu.

好的,如果我尝试使用我的域托管 example.com,一切都会好起来的.但是,当我尝试使用浏览器时,我得到了这个:

Ok, if I try host example.com with my domain, all is ok. But, when I try with the browser, I get this:

Heroku |没有这样的应用程序没有在该主机名上配置的应用程序.也许应用程序所有者已将其重命名,或者您输入的 URL 有误

Heroku | No such app There is no app configured at that hostname. Perhaps the app owner has renamed it, or you mistyped the URL

我也尝试使用命令 heroku domain:add yourdomain.com但这会创建我的应用程序的第二个实例,它不会将其重定向到完整的域 www

I tried also with the command heroku domains:add yourdomain.com but this create a second instance of my app, it doesn't redirect it to the full domain www

推荐答案

Heroku 强烈建议不要使用 A 记录将域指向云应用程序.使用 A 记录会增加 DNS 解析不稳定的可能性.Heroku 详细介绍此处.

Heroku highly advises against using A-records to point domains at cloud apps. Using A-records increases the chance of instability for DNS resolution. Heroku goes into details here.

相反,您应该将您的裸域重定向到www"子域.你可以参考这个SO线程了解更多关于如何设置这取决于 GoDaddy.

Instead, you should redirect your naked domain to the 'www' subdomain. You can refer to this SO thread for more details on how to set that up on GoDaddy.

这篇关于Heroku Godaddy 裸域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆