Local dns created is not working for redis configuration

Actually , I want my configuration files to take local dns like e2e.redis.qr.local rather than IP and the ip is configured like e2e.redis.qr.local=10.5.4.* in load balancer which is hosted by Nginx.

If I keep the ip in place of dns in all the config files, it is working fine, redis is working.

If I keep the dns , then the below exception is coming.
Caused by: redis.clients.jedis.exceptions.JedisConnectionException: Unknown reply: H

I am not able to understand how to resolve this. Some Stack overflow suggested like tcp host is needed. Redis wont accept the http host connection.

So, can we configure the dns with redis in place of ip?

Please do help me out of the situation.