All Products
Search
Document Center

Elastic Compute Service:Configure DNS settings for Cloud Assistant

Last Updated:Feb 08, 2024

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

Scenarios

When you use Cloud Assistant, such as to run commands, on an Elastic Compute Service (ECS) instance, the instance must have access to relevant endpoints to perform the actions that you specify. The default DNS Nameserver is installed and ready for use on ECS instances to resolve the endpoints of Cloud Assistant, without the need for additional configurations.

However, if you modify the configuration file of an instance and overwrite the default DNS Nameserver settings, endpoints may fail to resolve or resolve in a slow manner. This may cause Cloud Assistant to be unavailable. If this occurs, we recommend that you configure DNS settings to ensure that Cloud Assistant runs as expected.

You can perform one of the following operations based on the operating system of your instance to view the default DNS Nameserver settings. If the non-default settings are displayed in the command output, configure DNS settings for Cloud Assistant.

Linux instance

Run the cat /etc/resolv.conf command to view the default DNS Nameserver settings, as shown in the following figure.

default-nameserver

Windows instance

Run the nslookup command in Windows PowerShell to view the default DNS Nameserver settings, as shown in the following figure.

2023-05-26_18-09-30..png

Procedure

Linux instance

  1. Connect to the Linux instance.

    For more information, see Connect to a Linux instance by using a password or key.

  2. Obtain the IP addresses that correspond to Cloud Assistant endpoints.

    The following Cloud Assistant endpoints are available:

    • Endpoint used to run Cloud Assistant commands, in the <region-id>.axt.aliyun.com format.

    • Endpoint used to obtain Cloud Assistant plug-ins and update packages, in the aliyun-client-assist-<region-id>.oss-<region-id>-internal.aliyuncs.com format.

      Note

      Replace <region-id> with a region ID. For more information, see Regions and zones.

    For example, to obtain the IP addresses that correspond to the regional Cloud Assistant endpoints for the China (Beijing) region, run the following commands:

    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 Step 2.

  4. Check whether the hosts file is modified.

    cat /etc/hosts

    If the hosts file is modified, a command output is displayed, as shown in the following figure.view-hosts

    After the hosts file is modified, the instance can automatically obtain IP addresses from the hosts file to resolve the Cloud Assistant endpoints.

Windows instance

  1. Connect to the Windows instance.

    For more information, see Connect to a Windows instance by using a password or key.

  2. Obtain the IP addresses that correspond to Cloud Assistant endpoints.

    The following Cloud Assistant endpoints are available:

    • Endpoint used to run Cloud Assistant commands, in the <region-id>.axt.aliyun.com format.

    • Endpoint used to obtain Cloud Assistant plug-ins and update packages, in the aliyun-client-assist-<region-id>.oss-<region-id>-internal.aliyuncs.com format.

      Note

      Replace <region-id> with a region ID. For more information, see Regions and zones.

    For example, to obtain the IP addresses that correspond to the regional Cloud Assistant endpoints for the China (Beijing) region, run the following commands in Windows PowerShell:

    ping cn-beijing.axt.aliyun.com
    ping aliyun-client-assist-cn-beijing.oss-cn-beijing-internal.aliyuncs.com

    获取域名IP..png

  3. In Windows PowerShell, run the following commands to modify the hosts file:

    "100.100.XX.XX cn-beijing.axt.aliyun.com" | Add-Content C:\Windows\System32\drivers\etc\hosts
    "100.118.XX.XX aliyun-client-assist-cn-beijing.oss-cn-beijing-internal.aliyuncs.com" | Add-Content C:\Windows\System32\drivers\etc\hosts
    Note

    Replace 100.100.XX.XX and 100.118.XX.XX with the IP addresses that you obtained in Step 2.

  4. Check whether the hosts file is modified.

    cat C:\Windows\System32\drivers\etc\hosts

    If the hosts file is modified, a command output is displayed, as shown in the following figure.

    查看域名IP..png

    After the hosts file is modified, the instance can automatically obtain IP addresses from the hosts file to resolve the Cloud Assistant endpoints.