Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm trying to move my server from linode to EC2 and am following the guide located here -

One problem I have is when I set my hostname to my public DNS:

echo "ec2-46-51-***-**" > /etc/hostname

And add to my elastic ip and public DNS to /etc/hosts:

46.51.***.*** c2-46-51-131-72

I can no longer log on. Should I be using internal IP and private dns names?


share|improve this question
up vote 1 down vote accepted

The internal and private IPs/DNs are only for use from within the Amazon network (i.e., from other EC2 servers). The elastic IP only allows you to bind a static IP to a chosen VM. You should probably be doing one of two things:

  1. Connect to the public IP that's generated whenever you launch a new instance, or
  2. Bind the elastic IP and use that.

Neither should require you modifying the network setup on the VM.

Good luck!

share|improve this answer
Thanks. So for a web server I don't need to change my hosts file at all? Or change my hostname? – bradley Sep 9 '10 at 13:27
You shouldn't, no, but try it without touching the system files first to confirm. When tweaking configs, you should always start with the defaults, and then work from there. – Andrew M. Sep 9 '10 at 13:37

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.