一个和我一起工作的人给了我登录到他的EC2控制台的EC2凭证。不是我设的局。一些实例显示公共dns名称,而其他实例则显示空白的公共dns。我希望能够连接到具有空白公共DNS的实例。我一直无法弄清楚为什么这些显示为空白。
当前回答
进入VPC 选择VPC 单击“操作”,选择“编辑DNS主机名” “DNS主机名”勾选“启用” 单击保存更改
其他回答
进入VPC控制台,选择您的VPC,单击“操作”菜单,选择“编辑DNS主机名”—选择“是”。这应该能解决问题。
听起来像是在VPC中启动了实例,但没有选中“自动为实例分配公共IP地址”的复选框。因此实例没有公共IP
您可以为该实例分配一个弹性IP,然后使用该IP登录。
您不必为实例分配公共ip地址。 可以使用NAT实例,也可以使用NAT网关。
https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Scenario2.html https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-comparison.html
如果实例在VPC内,请确保“DNS解析”和“DNS主机名”均为“yes”。您可以在Aws控制台UI中完成此操作。HTH !
在这里,我将总结最常见的问题:
When you create a custom VPC, if you want aws resources such as ec2 instances to acquire public IP addresses so that the internet can communicate with them, then you first must ensure that the ec2 instance is associated with a public subnet of the custom VPC. This means that subnet has an internet gateway associated with it. Also, you need to ensure that the security group of the VPC associated with ec2 instance has rules allowing inbound traffic to the desired ports, such as ssh, http and https. BUT here are some common oversights that still occur:
1)确保VPC已启用DNS主机名
2)您必须确保连接到EC2实例的公共子网启用了“自动分配公共ip”标志
3)如果实例已经创建,那么您可能需要终止它,并为要填充的公共IP和公共DNS字段创建一个新实例。
推荐文章
- 拒绝访问;您需要(至少一个)SUPER特权来执行此操作
- 我如何使用通配符“cp”一组文件与AWS CLI
- 我如何获得亚马逊的AWS_ACCESS_KEY_ID ?
- 如何使所有对象在AWS S3桶公共默认?
- 为什么我应该使用亚马逊Kinesis而不是SNS-SQS?
- 如何重命名AWS S3 Bucket
- AWS ECS中的任务和服务之间有什么区别?
- 亚马逊SimpleDB vs亚马逊DynamoDB
- 亚马逊ECS和亚马逊EC2有什么区别?
- 我如何知道我在S3桶中存储了多少对象?
- S3 Bucket操作不应用于任何资源
- 将AWS凭证传递给Docker容器的最佳方法是什么?
- 当权限为S3时,AccessDenied for ListObjects for S3 bucket:*
- 电子邮件地址未验证(AWS SES)
- 使用Boto3将S3对象作为字符串打开