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

A newbie question on Amazon. I want to install within Amazon EC2 multiple servers based XMPP ejabberd, probably within a cluster and if possible with a load balancer.

The first question that arises is about the DNS:

I have a registered domain (eg which the XMPP server instances are, for example,,, etc ...

Reading the technical documentation of Amazon EC2, I have seen that says that all instances running in EC2 will have a dns name external and one internal, but as I understand this does not have to coincide with xmpp1.example, com, etc ... In addition, the documentation insists that these values ​​can not be changed.

Further, XMPP needs reverse resolution and documentation of Amazon insists that reverse lookup will always result in the external DNS name of the instance Amazon. Is this correct?

So what solution is there? How can I link the instances running on Amazon EC2 dns names?. I need both reverse zones as in the reverse? Also, how I can include SRV records?

I have also seen that there is the concept of elastic fixed IP address on the Internet. Is it a possible solution, for example, have two IPs for load balancers and can take some external DNS to resolve DNS names?

Anyway, I have many doubts about how this infrastructure can address and meet the XMPP protocol.

share|improve this question
up vote 2 down vote accepted

You need to point your xmpp hostnames to the EC2 instances, either using CNAME records to Amazon's hostnames:  IN  CNAME

or using A records directly to the IP:  IN  A

The advantage of the CNAME approach is that other EC2 instances looking up the name will resolve to the internal IP. Your SRV records should stay the same as before, and simply point to

If you don't use Elastic IPs the instances will get different IPs each time they are started. If updating DNS every time this happens isn't feasible then you have to use Elastic IPs.

I've never heard of XMPP requiring PTR records to match the forward lookup, this is usually only necessary for SMTP. I've run XMPP servers where this hasn't been the case and haven't had any problems. If you really want this, Amazon do let you configure reverse lookups for Elastic IPs, but this is intended for mail servers and so you may need to convince them that you need this.

share|improve this answer
Thanks mgorven! Your response has been very useful. Will review the issue of the PTR, in internal testing that I had done if necessary. On the issue of DNS .. Does the instance to launch EC2 server always has the same name but the boot off and after? How will I put in an external DNS A record with a private ip? Thank you! – aelbaz Aug 28 '12 at 6:58
@aelbaz Added to answer. – mgorven Aug 28 '12 at 21:43
RFC 2782 (that defines SRV records) states that the Target of an SRV record MUST NOT be an alias (CNAME). – Zash Sep 2 '12 at 1:39
That's right, no PTR records are needed to query the DNS in EC2 xmpp machine. thanks – aelbaz Sep 4 '12 at 11:03

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.