Question

I've setup a Redis Server on AWS. The Redis server has its own security group: sg-redis. I also have a webserver under another security group (sg-webserver) which is suppose to be able to connect to the redis server. For this security group I've opened:

  • TCP 6379 for sg-webserver
  • TCP 22 for sg-webserver

My redis server has an Elastic IP associated with the EC2 instance.

From the webserver, if I telnet my redis server using the Elastic IP I get a connection timeout:

[root@web-server:~]# telnet 54.11.22.333 6379
Trying 54.11.22.333...
telnet: connect to address 54.11.22.333: Connection timed out

Now I do the same using the Public DNS of the Redis server:

[root@web-server:~]# telnet ec2-11-22-33-444.compute-1.amazonaws.com 6379
Trying 10.22.33.444...
Connected to ec2-11-22-33-444.compute-1.amazonaws.com.
Escape character is '^]'.

I can see that the webserver is translating the public DNS to the AWS internal IP (not the Elastic IP) so I guess this is why it's working.

Now my question is why this is not working with the Elastic IP ? Do I have to use the Public DNS internally?

Cheers, Maxime

Was it helpful?

Solution

Yes, you should use public DNS internally. For that reason alone, it will resolve to the internal or external ip depending where you use it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top