EC2 instance has no public DNS

后端 未结 18 1232
-上瘾入骨i
-上瘾入骨i 2020-12-22 16:26

A guy I work with gave me the EC2 credentials to log onto his EC2 console. I was not the one who set it up. Some of the instances show a public dns name and others have a bl

相关标签:
18条回答
  • 2020-12-22 17:10

    I had the same problem an solved it. Have a look at the step-by-step instructions:

    • Go to console.aws.amazon.com
    • Go To Services -> VPC
    • Open Your VPCs
    • select your VPC connected to your EC2 and
    • select Actions => Edit DNS Hostnames ---> Change DNS hostnames: to YES

    Hope this helps!

    Cheers

    0 讨论(0)
  • 2020-12-22 17:10

    Sounds like the instance was launched in VPC and while doing so, the check-box for Automatically assign a public IP address to your instances was not checked. Hence the instance does not have a public IP

    You can assign an Elastic IP to this instance and then log in using that IP.

    0 讨论(0)
  • 2020-12-22 17:10

    The change to the DNS Hostnames setting can also be done using the AWS CLI:

    aws ec2 modify-vpc-attribute --vpc-id $vpc_id --enable-dns-hostnames '{"Value": true}'
    

    (Where $vpc_id is the ID of the VPC that your instance is attached to.)

    As soon as the VPC is updated the instance will gain a public DNS.

    0 讨论(0)
  • 2020-12-22 17:10

    Go to VPC console, select your VPC, and click ACTIONS menu, select Edit DNS Hostnames - select Yes. That should fix it.

    0 讨论(0)
  • 2020-12-22 17:11

    There is a actually a setting in the VPC called "DNS Hostnames". You can modify the VPC in which the EC2 instance exists, and change this to "Yes". That should do the trick.

    I ran into this issue yesterday and tried the above answer from Manny, which did not work. The VPC setting, however, did work for me.

    Ultimately I added an EIP and I use that to connect.

    0 讨论(0)
  • 2020-12-22 17:13
    1. Go to AWS Console.
    2. Go to Services and select VPC
    3. Click on vpc.
    4. select the instance and click on Action.
    5. Select Edit DNS Host name click on yes.

    At the end you will get your Public dns.

    0 讨论(0)
提交回复
热议问题