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

If I setup my hosts files such that they reference all other ec2 nodes using the internal ip addresses, will this work or do I have to use the external ip addresses?

Do I need to specify anything in my security group to get internal ip addresses to work?

e.g. /etc/hosts

ip-10-11-12-13.internal  some_node_name

If I do this, can I reference some_node_name anywhere in my scripts where I would have used the ip address previously?

On my puppet agent servers, I have a reference to my puppet master like:

public-ip-here puppet

When I reboot my puppet agent's, syslog shows they couldn't find the master with the message: getaddinfo : name or service not known

I did get it to work by updating /etc/default/puppet

and I added to the options:


From what I read, puppet will by default try using 'puppet', and I set this in my hosts file so why wouldn't it be picking this up?

share|improve this question

One tip for using puppet in EC2 is to assign an ElasticIP to your puppetmaster, and then create a DNS entry for the ElasticIP CNAME and not an A record for the IP.

AWS DNS servers use dns "views" to vary their response based on if the query came from within the same EC2 region, or exterior. If the CNAME request comes from within a EC2 region, the AWS DNS servers will respond with the internal IP of the CNAME. (Go read about BIND "Views" for conditional DNS responses)

You should use the CNAME in DNS so that when EC2 puppet clients query the AWS DNS servers for the IP of the Puppetmaster, they will receive a response that directs them to the internal IP of the puppetmaster, and not the external IP.

Summary: don't use /etc/hosts to find the puppetmaster in EC2, that internal IP may change, and doesn't work across multiple regions. Use a CNAME record that points to the ElasticIP CNAME stored in DNS.

share|improve this answer

that hosts file is wrong.. If your puppet server has an internal IP of Then each node you want to connect to it is puppet

Then that node will connect just fine with no --server line. If all the nodes are in US-east they have to use the internal IP. If your puppet server is in east and some clients on west.. Those clients on west use public and the east ones still use internal.

share|improve this answer
ok so the internal ip, I have to remove the dashes and the suffic .internal? – Blankman May 30 '11 at 1:58
btw, it works when I use the public IP in the same region, so public ip's do work...thanks! – Blankman May 30 '11 at 1:59
Removed incorrect line about EC2 public IP connections. – Nathan V Sep 8 '15 at 23:04

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.