简体   繁体   English

如何将DNS指向动态IP地址?

[英]How to point DNS at a dynamic IP address?

Bluehost is my DNS provider and my app is hosted on heroku. Bluehost是我的DNS提供商,我的应用程序托管在heroku上。 I'm trying to point the DNS at my heroku app but there's an issue. 我正在尝试将DNS指向我的heroku应用程序,但是有一个问题。 Heroku's documentation states the following: Heroku的文档指出以下内容:

Some DNS providers will only offer A records for root domains. 一些DNS提供商仅提供根域的A记录。 Unfortunately, A records will not suffice for pointing your root domains to Heroku because they require a static IP. 不幸的是,A记录不足以将您的根域指向Heroku,因为它们需要静态IP。 These records have serious availability implications when used in environments such as on-premise data-centers, cloud infrastructure services, and platforms like Heroku. 当在内部数据中心,云基础架构服务和Heroku等平台中使用这些记录时,这些记录会对可用性产生严重影响。 Since Heroku uses dynamic IP addresses, it's necessary to use a CNAME-like record (often referred to as ALIAS or ANAME records) so that you can point your root domain to another domain. 由于Heroku使用动态IP地址,因此必须使用类似CNAME的记录(通常称为ALIAS或ANAME记录),以便您可以将根域指向另一个域。 See examples below. 请参阅下面的示例。

They go on to recommend creating a CNAME record with the values @ and your root domain alias, eg hidden-sierra-7936.herokudns.com . 他们继续建议使用值@和您的根域别名创建CNAME记录,例如hidden-sierra-7936.herokudns.com

But Bluehost won't allow this because they want an IPv4 IP Address only and won't accept something like hidden-sierra-7936.herokudns.com as a valid CNAME record. 但是Bluehost不允许这样做,因为他们只需要一个IPv4 IP地址,并且不会接受诸如hidden-sierra-7936.herokudns.com类的有效CNAME记录。 I've already done the www record and things aren't working, so I'm guessing I need the ANAME record as well. 我已经完成了www记录,但无法正常工作,所以我想我也需要ANAME记录。

在此处输入图片说明

Is there any way around this other than switching to a new DNS provider? 除了切换到新的DNS提供商之外,还有其他方法吗?

Bluehost does not support this. Bluehost不支持此功能。 Google and Cloudflare do, perhaps others. Google和Cloudflare也许也有。 Cloudflare worked for me. Cloudflare为我工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM