Help Center> Distributed Cache Service> FAQs> Client and Network Connection> Should I Use a Domain Name or an IP Address to Connect to a DCS Redis Instance?
Updated on 2023-06-16 GMT+08:00

Should I Use a Domain Name or an IP Address to Connect to a DCS Redis Instance?

  • Single-node and Proxy Cluster:

    Each instance has only one IP address and one domain name address. The addresses remain unchanged before and after master/standby switchover. You can use either address to connect to the instance.

  • Master/standby (basic edition):

    Each instance has one IP address and two domain name addresses. One of the domain name addresses is used only for processing read requests. The addresses remain unchanged after master/standby switchover. You can use any address to connect to the instance.

    When you use a domain name address, distinguish between read and write requests. If you use Connection Address or IP Address, functions are not affected. If you use Read-only Address, only read requests are processed. You are advised to use read/write splitting instances if you have read/write splitting requirements.

  • Redis 6.0 (professional edition)

    Use the domain name for connection. There may be multiple IP addresses or they may change.

  • Redis Cluster:

    A Redis Cluster instance has multiple pairs of master and replica IP addresses and one domain name address. You can use any address to connect to the instance.

    The connected node sends requests to the correct node. All nodes in the cluster can receive requests. Configure multiple or all IP addresses to prevent single points of failure.

  • Domain names cannot be resolved across regions. If the client and the DCS Redis instance are not in the same region, the instance cannot be accessed using its domain name address. You can manually map the domain name to the IP address in the hosts file or access the instance using its IP address. For details, see Restrictions.
  • For details about how to connect to an instance, see Accessing a DCS Redis Instance.

Client and Network Connection FAQs

more