EC2 in public subnet reachable by public IP but not by public DNS

0

When launching ec2 instance in a specific public subnet, the instances automatically show a Public IPv4 address and a Public IPv4 DNS. However, they are only reachable (by SSH) through their IP address; not through their DNS name. What could be the cause? Some additional information:

  • The VPC containing the subnet has "DNS hostnames" enabled and "DNS resolution" enabled.
  • The Subnet ACL allows all traffic.
질문됨 2년 전1088회 조회
2개 답변
0

Your VPC automatically has a private Route 53 zone to which the private IP address of the EC2 instance is added. But that won't help you connect to the public IP address of the instance. You will need to have a Route 53 public hosted zone (or a public hosted zone from another DNS provider) and add the public IP address of the EC2 instance to that zone.

That you can connect using the IP address is good - it means that everything there is correct; it's a matter now of ensuring that the DNS records are in place.

Edit (based on excellent feedback from a colleague): I had missed that you'd mentioned the Public DNS that is automatically assigned. It is of the format ec2-xx-xx-xx-xx.region-name.compute.amazonaws.com which means you should be able to use that as well as the IP. My answer above applies if you want a custom DNS name.

profile pictureAWS
전문가
답변함 2년 전
profile pictureAWS
전문가
검토됨 2년 전
0

Hi I also encountered the same problem. How did you solve it in the end

답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠