Configure DNS resolution for Cloud Assistant

更新时间:
复制 MD 格式

Add Cloud Assistant endpoint IP addresses to the hosts file to restore DNS resolution when custom DNS settings break it.

Use cases

Cloud Assistant requires access to its service endpoints to run commands on ECS instances. The default DNS nameserver on ECS instances resolves these endpoints without additional configuration.

If you overwrite the default DNS nameserver settings, endpoint resolution may fail or slow down, making Cloud Assistant unavailable. In this case, manually configure DNS resolution to restore Cloud Assistant.

Run the following command for your OS to check the current DNS nameserver. If the output shows non-default settings, configure DNS resolution for Cloud Assistant.

Linux instance

Run the cat /etc/resolv.conf command to view the DNS nameserver settings.

default-nameserver

Windows instance

Run the nslookup command in Windows PowerShell to view the DNS nameserver settings.

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

Procedure

Linux instance

  1. Connect to the Linux instance.

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

    Cloud Assistant uses the following endpoints:

    • Command execution: <region-id>.axt.aliyun.com

    • Plug-in and update packages: aliyun-client-assist-<region-id>.oss-<region-id>-internal.aliyuncs.com

      Note

      Replace <region-id> with your region ID. See Regions and zones.

    For example, to obtain the endpoint IP addresses 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. Verify the hosts file update.

    cat /etc/hosts

    The output shows the updated hosts file entries.view-hosts

    The instance now resolves Cloud Assistant endpoints using the IP addresses in the hosts file.

Windows instance

  1. Connect to the Windows instance.

  2. Obtain the Cloud Assistant endpoint IP addresses.

    Cloud Assistant uses the following endpoints:

    • Command execution: <region-id>.axt.aliyun.com

    • Plug-in and update packages: aliyun-client-assist-<region-id>.oss-<region-id>-internal.aliyuncs.com

      Note

      Replace <region-id> with your region ID. See Regions and zones.

    For example, to obtain the endpoint IP addresses 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

    Obtain endpoint IP addresses

  3. Run the following commands in Windows PowerShell 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. Verify the hosts file update.

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

    The output shows the updated hosts file entries.

    View hosts file entries

    The instance now resolves Cloud Assistant endpoints using the IP addresses in the hosts file.