英文:
Route53 domain not connecting to cloudfront distribution with static site
问题
问题
我有一个使用Next.js构建的静态网站,我正在S3上托管并使用CloudFront提供服务。我已经验证了该网站在CloudFront URL上运行良好。问题出现在尝试将其连接到我在Route 53注册的域名时。如果有所区别,我最初是在Bluehost上创建的域名,然后迁移到了AWS。
dig NS <my-domain>
返回SERVFAIL而不是域名服务器- 在浏览器中访问该域会显示ERR_NAME_NOT_RESOLVED
我尝试遵循这篇文章,但似乎我还是遗漏了一些东西:https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html
当前配置
Cloudfront
- 替代域设置为
www.<my-domain>.com
和<my-domain>.com
- 自定义SSL证书设置为我创建和验证的同一个ACM证书
- IPv6已启用
Route53托管区域
- 记录
- 用于
www.<my-domain>.com
的A别名记录 -> cloudfront分发 - 用于
www.<my-domain>.com
的AAAA别名记录 -> cloudfront分发 - 用于
<my-domain>.com
的A别名记录 -> cloudfront分发 - 用于
<my-domain>.com
的AAAA别名记录 -> cloudfront分发 - NS记录,我已将其更改为与注册的域名页面中显示的名称服务器相同
- 用于
- 在托管区域详细信息下,显示的名称服务器与NS记录和注册的域名页面中显示的不同
Route53注册的域名
- 域名状态代码
- clientDeleteProhibited
- clientTransferProhibited
- clientUpdateProhibited
ACM
- 证书已成功请求并验证电子邮件
- 域名为
<my-domain>.com
和*.<my-domain>.com
- 关联资源显示我的cloudfront分发
- 状态为"Issued"
是否有什么我遗漏的东西导致DNS无法解析?如果需要提供更多信息,请告诉我。
dig NS <my-domain>.com
或www.<my-domain>.com
返回SERVFAIL而不是域名服务器- 在浏览器中访问该域时,显示ERR_NAME_NOT_RESOLVED而不是网站
- 更新Route53中的NS记录以匹配注册的域名没有解决DNS问题
- 更新Route53注册的域名中的名称服务器列表以匹配托管区域的名称服务器(显示状态“失败”)没有解决问题。
英文:
Problem
I have a nextjs static site I am hosting on S3 and serving with cloudfront. I have already validated that the website works fine with the cloudfront url. The problem arises when trying to connect it to my domain I have registered in route53. If it makes a difference, I originally created the domain with bluehost and then transfered over to aws.
dig NS <my-domain>
returns SERVFAIL instead of the nameservers- going to the domain in the browser gives ERR_NAME_NOT_RESOLVED
I tried following this article pretty closely but seems I'm still missing something: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html
current configuration
Cloudfront
- alternate domains set as
www.<my-domain>.com
and<my-domain>.com
- custom ssl cert is set as the same ACM cert I created and validated
- ipv6 is on
Route53 hosted zone
- records
- A alias record for
www.<my-domain>.com
-> cloudfront dist - AAAA alias record for
www.<my-domain>.com
-> cloudfront dist - A alias record for
<my-domain>.com
-> cloudfront dist - AAAA alias record for
<my-domain>.com
-> cloudfront dist - NS record that I've changed to be the same as what shows up under name servers in the registered domains page
- A alias record for
- under hosted zone details, shows different name servers than both the NS record and what appears in the registered domain page
Route53 registered domains
- Domain status code
- clientDeleteProhibited
- clientTransferProhibited
- clientUpdateProhibited
ACM
- cert requested and email validated successfully
- domains are
<my-domain>.com
and*.<my-domain>.com
- associated resources shows my cloudfront dist
- status is "Issued"
Is there anything I am missing that is causing the dns to not resolve? Let me know if I need to provide more info.
dig NS <my-domain>.com
orwww.<my-domain>.com
returns SERVFAIL instead of the nameservers- going to the domain in the browser gives ERR_NAME_NOT_RESOLVED instead of website
- updating the NS record in route53 to match the registered domain did not resolve dns
- updating the name servers list in route53 registered domains to match hosted zone's name servers (shows status "failed")
答案1
得分: 0
"NS record that I've changed to be the same as what shows up under name servers in the registered domains page"
应该相反操作。您需要更新您注册域的名称服务器,以与最初提供的托管区域相同。
英文:
> "NS record that I've changed to be the same as what shows up under name servers in the registered domains page"
You should have done the opposite. You need to update your registered domain's name servers to be whatever the hosted zone initially gave you.
答案2
得分: 0
DNS解析被阻止的缺失部分是,NS记录、托管区详细信息的名称服务器以及域名注册页面上的胶水记录在应该相同的情况下不相同。在我尝试重新创建托管区并在故障排除期间编辑NS记录后,它们不同步了。
英文:
The missing piece that prevented DNS resolution was that the NS records, hosted zone details name servers, and glue records in the domain registration page were not identical when they should be. They got out of sync after I tried re-creating my hosted zone and editing the NS records while troubleshooting.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论