Skip to content

Instantly share code, notes, and snippets.

@marcosgz
Created February 22, 2017 20:06
Show Gist options
  • Save marcosgz/3e04c184aa70a07ab2fdf01c28038067 to your computer and use it in GitHub Desktop.
Save marcosgz/3e04c184aa70a07ab2fdf01c28038067 to your computer and use it in GitHub Desktop.
/opt/aws/bin/ec2-metadata -p will print the public hostname of that instance.
$ /opt/aws/bin/ec2-metadata -p
public-hostname: ec2-***-***-***.compute-1.amazonaws.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment