简体   繁体   中英

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. This is going to be my MongoDB instance and will only be accessed by other servers within the VPC. I established a successful VPN connection and can SSH using Putty to the instance using the private IP address - "10.0.0.95". So far, so good. I noticed that the private IP address also has a Private 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". Clearly, I can use the 10.0.0.95 IP address but was surprised that the private DNS name did not work. How come?

You should enable the DNS resolution for your VPC, or you won't be able to resolve internal DNS names.

To use private hosted zones, you must set the following Amazon VPC settings to true:

  • enableDnsHostnames
  • enableDnsSupport

Steps to enable DNS resolution:

  • Open the Amazon VPC console at https://console.aws.amazon.com/vpc/ .
  • In the navigation pane, choose Your VPC.
  • Select the VPC from the list, choose Actions and either Edit DNS Resolution or Edit DNS Hostnames (you should enable them)
  • 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM