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 have a web server with a separate database server in this case a MongoDB, both are hosted on EC2, but when connecting my webserver to my database server is it best to use the public IP address or the private local one (10...*).

I'd like to have the best performance and security.

share|improve this question
up vote 1 down vote accepted

You want the private IP address for that. The public IP should only be used for public-facing services, and your Mongo is not such a service.

share|improve this answer
Are there any benifits giving it an CNAME? Like then it would be, or is that just a waste of DNS lookups just to make my app configure easier to read too... I'm taking your answer as my solution, but I was curious if having a CNAME could make it easier if I wanted to make another server write to the DB too. – JP Silvashy Nov 4 '11 at 18:17
It is possible to build your own private DNS on a private domain (or even something like '') to make this easier too, and it should scale up well should the need arise. – sysadmin1138 Nov 4 '11 at 18:47

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.