简体   繁体   English

为什么我无法使用私有DNS地址访问AWS实例

[英]How come I can't access AWS instance using Private DNS Address

I set up an AWS instance in my VPC with a private IP address -- no public IP address. 我在VPC中使用私有IP地址(没有公共IP地址)设置了一个AWS实例。 This is going to be my MongoDB instance and will only be accessed by other servers within the VPC. 这将是我的MongoDB实例,并且只能由VPC中的其他服务器访问。 I established a successful VPN connection and can SSH using Putty to the instance using the private IP address - "10.0.0.95". 我建立了成功的VPN连接,可以使用Putty通过私有IP地址“ 10.0.0.95”对实例进行SSH。 So far, so good. 到现在为止还挺好。 I noticed that the private IP address also has a Private DNS - "ip-10-0-0-95.internal". 我注意到私有IP地址也有一个私有DNS-“ ip-10-0-0-95.internal”。 I tried using the Private DNS to access the instance through the VPN but got this Putty error "Unable to open connection to ip-10-0-0-95.ec2.internal. Host does not exist". 我尝试使用专用DNS通过VPN访问实例,但收到此Putty错误“无法打开与ip-10-0-0-95.ec2.internal的连接。主机不存在”。 Clearly, I can use the 10.0.0.95 IP address but was surprised that the private DNS name did not work. 显然,我可以使用10.0.0.95 IP地址,但是对于私有DNS名称不起作用感到惊讶。 How come? 怎么会?

You should enable the DNS resolution for your VPC, or you won't be able to resolve internal DNS names. 您应该为您的VPC启用DNS解析,否则您将无法解析内部DNS名称。

To use private hosted zones, you must set the following Amazon VPC settings to true: 要使用私有托管区域,您必须将以下Amazon VPC设置设置为true:

  • enableDnsHostnames enableDnsHostnames
  • enableDnsSupport enableDnsSupport

Steps to enable DNS resolution: 启用DNS解析的步骤:

  • Open the Amazon VPC console at https://console.aws.amazon.com/vpc/ . 通过https://console.aws.amazon.com/vpc/打开Amazon VPC控制台。
  • In the navigation pane, choose Your VPC. 在导航窗格中,选择您的VPC。
  • Select the VPC from the list, choose Actions and either Edit DNS Resolution or Edit DNS Hostnames (you should enable them) 从列表中选择VPC,选择“操作”,然后选择“编辑DNS解析”或“编辑DNS主机名”(应启用它们)
  • In the dialog box that opens, choose Yes, and Save. 在打开的对话框中,选择“是”,然后选择“保存”。

For more info: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html#vpc-dns-updating 有关更多信息: http : //docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html#vpc-dns-updating

暂无
暂无

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

相关问题 我在私有子网中有 AWS Postgres 实例,但我没有任何 VPN,如何通过本地访问它? - I have AWS Postgres instance in private subnet and I don't have any VPN, How Can I access it through Local? 我已经更改了 AWS EC2 实例的区域。 但是我看不到来自新 IP 地址和公共 DNS 的网站 - I've changed region for AWS EC2 instance. But I can't see a website from new IP address and Public DNS 如何通过Powershell中的IAM角色过滤AWS实例并获取该实例的私有IP地址? - How can I filter AWS Instances by IAM role in powershell and get the private ip address of that instance? AWS EC2 (AWS Linux) 我如何访问私有实例 - AWS EC2 (AWS Linux) how I access a private instance 为什么无法从Amazon的AWS管理控制台中捆绑实例? - How come I can't bundle an instance from Amazon's AWS Management console? 如何使用aws cli过滤器获取AWS实例名称和私有IP列表 - how can I get a list of AWS instance names and private IPs using aws cli filters 如何确保私有 DNS - 地址在 AWS EC2 中不会更改? - How to ensure that Private DNS - address does not change in AWS EC2? AWS Fargate 无法解析私有 DNS Route 53 - AWS Fargate can't resolve Private DNS Route 53 AWS中如何让新主机继承私有dns域名自动形成FQDN? - How can I get new hosts to inherit the private dns domain name to automatically form an FQDN in AWS? 在 AWS 上预置实例时,如何为公共和私有 DNS 使用自定义域? - How can I use a custom domain for public and private DNS when provisioning instances on AWS?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM