Get public dns name of a ec2 instance using ec2 command line tools in bash


I have name of the a ec2 instance and want to do ssh to it. How can I figure out the ‘Public DNS’ of the ec2 instance using the ec2 instance name.

I want to do it using bash.


Where i-12abc34 is your instance id

Leave a Reply