DNS resolution failures on an Elastic Compute Service (ECS) instance can prevent connections to a Tair (Redis® OSS-Compatible) instance. The following error messages indicate a DNS resolution failure:
Name or service not knownUnknownHostExceptionfailed to connect: r-***************.redis.rds.aliyuncs.com could not be resolved
If you receive any of these errors, check the endpoint and DNS server settings on your ECS instance.
Resolution steps
The following steps use a Linux environment as an example.
Step 1: Verify the endpoint
Confirm that the Tair endpoint in your application code is correct.
Open the Tair console.
Go to the instance details page.
In the Endpoint section, locate the Endpoint column.

Compare the endpoint in your application code with the value shown in the console. If they do not match, update your code to use the correct endpoint.
Step 2: Check the DNS server configuration
Verify that the correct DNS server is configured on the ECS instance.
For details, see An ECS instance that runs Linux fails to resolve domain names.
To confirm DNS resolution works, run the following command. Replace the placeholder with your Tair endpoint:
nslookup r-***************.redis.rds.aliyuncs.comIf the command returns an IP address, DNS resolution is working correctly.
Step 3 (optional): Add a temporary host mapping
If Step 1 and Step 2 do not resolve the issue, add a domain-to-IP mapping for the Tair instance to the /etc/hosts file. This bypasses DNS resolution and restores connectivity.
After restoring connectivity, see Troubleshoot Tair connection issues to rule out other causes.
Editing the /etc/hosts file follows a process similar to editing /etc/resolv.conf. However, this is a temporary fix. If the IP address of the Tair instance changes, the mapping becomes invalid and must be updated manually.