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
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.