Take the 2-minute tour ×

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
add comment

2 Answers

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
add comment

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.

With ec2, you cannot reach the public ip for a node in your same region, you have to use internal IP

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
add comment

Your Answer


