如何为 Name.com 和 Heroku 应用程序配置 DNS 记录 [英] How to configure DNS records for Name.com and a Heroku app

查看:16
本文介绍了如何为 Name.com 和 Heroku 应用程序配置 DNS 记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对如何在 Name.com 上为我的域设置 DNS 记录感到有些困惑,以便它可以正确地指向我的 Heroku 应用程序.

我在 heroku 的网站上找到了 DNS 配置文档,但我仍然很困惑.

我的印象是我需要为所有子域设置 CNAME 记录,并为我的根域设置 A 记录.

此外,在 name.com 网站上,当我尝试添加 CNAME 时,我需要填写三个空白字段,我需要填写哪一种让我感到困惑:主机"(我在其中输入*",因此它适用于所有子域?)、答案"(我在其中输入 DNS 目标?)和TTL"

任何帮助将不胜感激.谢谢.

解决方案

不要为您的根域使用 A 记录.Heroku 使用易变的 IP 地址,这意味着您在 A 记录中配置的 IP 可以随时停止工作,恕不另行通知.
参见 https://devcenter.heroku.com/articles/apex-domains>

在您的根域上,您需要通过您的 DNS 提供商设置一个到您 www 子域的 HTTP 重定向,或者使用另一个提供根域 CNAME 记录的提供商.

至于您的子域中的 CNAME,是的,主机"将是*"以表示您的所有子域.
答案将是 heroku 提供的端点,格式为 appname.herokudns.com..
TTL 表示 DNS 缓存应与客户端刷新的频率.使用默认值(或 3600,如果他们不提供任何)将在这里工作.

I'm a bit confused about how to set up the DNS records for my domain at Name.com so it can correctly point to my Heroku app.

I found DNS configuration documentation at heroku's site but I'm still confused.

I'm under the impression that I need to set up a CNAME record for all subdomains and an A record for my root domain.

Also, on the name.com website, when I try to add a CNAME there are three blank fields I need to fill out which kind of confuse me: "Host" (where I enter '*' so it applies to all subdomains?), "Answer" (where I enter the DNS Target?), and "TTL"

Any help would be greatly appreciated. Thank you.

解决方案

Don't use an A-record for your root domain. Heroku is using volatile IP addresses, which means the IP you configure in your A record can stop working at any moment without notice.
See https://devcenter.heroku.com/articles/apex-domains

On your root domain, you need to either setup an HTTP redirect to your www subdomain with your DNS provider, or use another provider which offers CNAME records for root domains.

As for the CNAME in your subdomains, yes, "Host" would be "*" to be all your subdomains.
Answer will be the endpoint provided by heroku, in the form appname.herokudns.com..
TTL means how often the DNS cache should be refreshed with the clients. Using the default (or 3600 if they don't provide any) will work here.

这篇关于如何为 Name.com 和 Heroku 应用程序配置 DNS 记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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