This topic describes how to configure Domain Name System (DNS) resolution for Cloud Assistant. During the configuration procedure, you must obtain the IP addresses that correspond to the Cloud Assistant endpoints and then modify the hosts file.

Background information

When you use features such as Cloud Assistant on an Elastic Compute Service (ECS) instance, the instance must have access to the endpoints required to perform the actions that you specify, such as running a Cloud Assistant command. The default DNS Nameserver is installed on each ECS instance to resolve domain names. You can run the cat /etc/resolv.conf command to view the DNS Nameserver settings. Example command output: default-nameserver

If you modify the configuration file to override the default DNS Nameserver settings, domain names may fail to resolve or resolve slowly when you use features such as Cloud Assistant. This may cause the features to be unavailable. For example, Cloud Assistant commands cannot be run. In this case, you can perform the following procedure to configure DNS resolution for Cloud Assistant.

Procedure

  1. Connect to an ECS instance. For more information, see Overview.
  2. Obtain the IP addresses that correspond to the Cloud Assistant endpoints.
    The following Cloud Assistant endpoints are available:
    • Endpoint used to run Cloud Assistant commands, in the format of <region-id>.axt.aliyun.com
    • Endpoint used to obtain the Cloud Assistant plug-in and update packages, in the format of aliyun-client-assist-<region-id>.oss-<region-id>-internal.aliyuncs.com
    Note Replace <region-id> with a region ID.
    In this example, the China (Beijing) region is used. Run the following commands to obtain the IP addresses that correspond to the Cloud Assistant endpoints:
    ping -c 4 cn-beijing.axt.aliyun.com
    ping -c 4 aliyun-client-assist-cn-beijing.oss-cn-beijing-internal.aliyuncs.com
    asist-ip
  3. Modify the hosts file.
    echo "100.100.XX.XX cn-beijing.axt.aliyun.com" >> /etc/hosts && \
    echo "100.118.XX.XX aliyun-client-assist-cn-beijing.oss-cn-beijing-internal.aliyuncs.com" >> /etc/hosts
    Note Replace 100.100.XX.XX and 100.118.XX.XX with the IP addresses that you obtained in the previous step.
  4. Check whether the hosts file is modified.
    cat /etc/hosts
    If the hosts file is modified, the command output includes the Cloud Assistant endpoints and their corresponding IP addresses. Example command output: view-hosts
    After the hosts file is modified, the ECS instance can automatically obtain IP addresses from the hosts file to resolve the Cloud Assistant endpoints.