[英]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:
Steps to enable DNS resolution: 启用DNS解析的步骤:
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.