EC2 t2.micro实例没有公共DNS [英] EC2 t2.micro instance has no public DNS

查看:450
本文介绍了EC2 t2.micro实例没有公共DNS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

EC2 t2.micro实例没有公共DNS

EC2 t2.micro instance has no public DNS

我启动了一个Amazon Web Service(AWS)EC2实例t2.micro,必须将其发布到VPC中。
VPC的自动分配公用IP设置为是。
DNS解析:是
DNS主机名:是
但是在EC2仪表板上,该实例仍然具有空白的Public DNS和Public IP。我曾尝试多次重启实例,但仍未为其分配公共IP。我们的AWS账户随附的5个弹性IP已被使用。是否可以在不使用弹性IP的情况下将公共IP分配给t2.micro实例?

I lanunched an Amazon Web Service (AWS) EC2 Instance, t2.micro, which must be launced into a VPC. The VPC has Auto-assign Public IP set to Yes. DNS resolution: Yes DNS hostnames: Yes But on the EC2 Dashboard, the instance still has a blank Public DNS and Public IP. I have tried to restart the instance several times, but it still has not been assigned a Public IP. The 5 Elastic IPs that came with our AWS account have already been used. It it possible to get a Public IP assigned to a t2.micro instance without using Elastic IP?

我已经阅读了以下文章:EC2实例没有公共DNS
,但是我没有信誉点可以添加评论,所以我将其发布为新问题。

I have read the post: EC2 instance has no public DNS, but I do not have reputation points to be able to add a comment, so I am posting this as new question.

推荐答案

根据您提供的信息,我不能100%确定我的答案是正确的,但这是一个想法。

Based on the information you provided, I can't be 100% sure my answer will be correct, but here is a thought.

最常见的导致EC2实例没有公共IP地址的原因是,您在以下位置启动EC2实例: 私有子网。专用子网意味着该子网中的任何EC2实例都不能直接从公共Internet寻址。换句话说,根据定义,私有子网中的EC2实例不能具有公共IP地址。

The most common cause of no public IP address for your EC2 instance is that you're launching your EC2 instance in a private subnet. A private subnet means that any EC2 instances located in that subnet are not directly addressable from the public Internet. In other words, by definition, EC2 instances in a private subnet cannot have a public IP address.

这将解释为什么检查公共IP地址无效,以及为什么您无法分配弹性IP地址。

This would explain why checking "public IP address" has no effect, and why you're unable to assign an Elastic IP address.

您不能只是将一个实例从一个子网重新定位到另一个子网。如果需要这样做,可以创建实例的AMI(右键单击EC2实例,然后单击创建映像),然后从该实例中启动一个新实例。

You can't just relocate an instance from one subnet to another. If you need to do that, you can create an AMI of your instance (right-click on the EC2 instance and click create image), and then launch a new instance from that AMI in a different subnet.

要确定您的子网是否私有,请查看路由表,看看是否有 Internet网关路由。转到 VPC > 子网>选择一个子网> 路由表标签。查找条目类似于 igw-*** 的条目。如果您看到此消息,则它是一个公共子网。如果您看到类似 eni-*** / i-*** 之类的内容,则它是一个私有子网。

To determine if your subnet is private, look at the Route Table and see if you have an Internet Gateway route. Go to VPC > Subnets > Select a Subnet > Route Table tab. Look for an entry that has something like igw-***. If you see this, it's a public subnet. If you see something like eni-*** / i-***, it's a private subnet.

这篇关于EC2 t2.micro实例没有公共DNS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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