Heroku Godaddy裸域 [英] Heroku Godaddy naked domain

查看:117
本文介绍了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

使用主机"命令检查您的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.

好吧,如果我在我的域中尝试 host 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 |没有这样的应用程序在该主机名上没有配置任何应用程序. 应用所有者可能已将其重命名,或者您输入了错误的网址

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 domains: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天全站免登陆