Deepakvg
Deepakvg

Reputation: 91

How to connect to Redis server using DNS?

We have a requirement to have a globalized cache machine i.e. Redis to be running on one server and the docker services running on other servers need to be able to access it. So we have created a docker container in Ec2 instance A and all the other services are in Instance B & C. We have installed redis-cli IP on Instnace A & Instance B and it's working. But we have a requirement to have DNS instead of IP here. So we have configured the records in Bastian host in the below format.


server {
        listen 80 ;
        server_name devtest-redis.xyz.com;
        return 301 https://$server_name$request_uri ;
}
server {
        listen 443;
        server_name devtest-redis.xyz.com;
        ssl on;
        ssl_certificate /etc/letsencrypt/live/xyz.com/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/xyz.com/privkey.pem;
        ssl_session_timeout 5m;
        ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
        ssl_prefer_server_ciphers on;
        add_header 'Access-Control-Allow-Origin' '*';
        location / {
                proxy_pass http://10.63.3.10:6379;
        }
   }

But when we type redis-cli -h devtest-redis.xyz.com, I'm getting the below error. Even if I give redis-cli -h IP:PORT , I get the same error. I'm missing something here or how can this be resolved?

Could not connect to Redis at https://devtest-redis.xyz.com:6379: Name or service not known

Upvotes: 1

Views: 457

Answers (0)

Related Questions