Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i would like to find the public IP address of my EC2 instance from within the server itself.I know it is possible using ec2-describe-instances. But i want to do it assuming ec2-api-tools are not installed.

Is there a way to find that out?

share|improve this question
up vote 9 down vote accepted



to get a list of other metadata you can get.

share|improve this answer
Nice! Fuller reference:… – Domingo Ignacio Galdos Jan 16 '13 at 22:08

There's a quick way to do it from the console on any server

With curl:

$ curl

With wget:

$ wget
share|improve this answer

Can't you just nslookup it?

share|improve this answer

As a matter of course, I now assign an Elastic IP to all new permanent (anything longer than a day) EC2 instances. This makes everything so much easier.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.