All Products
Search
Document Center

Elastic Compute Service:What do I do if the hostname cannot be updated after I change the hostname of a Windows instance and restart the instance?

Last Updated:Jul 08, 2024

This topic describes how to resolve the issue that the hostname of a Windows Elastic Compute Service (ECS) instance cannot be updated after you change the hostname and restart the instance.

Problem description

On a Windows instance, when you change the hostname and restart the system, the hostname fails to be updated.

View the event logs and check whether error events occurred.

Cause

The issue may be caused by firewall policies that prevent the instance from accessing metadata server. As a result, the hostname fails to be updated.

Solutions

Add an outbound firewall rule or disable the system firewall to allow the instance to access the metadata server. This resolves the issue caused by the hostname update exception.

Solution 1: Add an outbound firewall rule

  1. Connect to the Windows instance.

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

  2. Open the Windows Defender Firewall with Advanced Security window.

    1. Right-click the Dingtalk_20210510142550.jpg icon and select Run.

    2. Enter wf.msc in the Run dialog box and click OK.

  3. In the Windows Defender Firewall with Advanced Security window, click Outbound Rules and then click New Rule...

  4. In the New Outbound Rule Wizard dialog box, select Custom and click Scope in the left-side navigation pane.

  5. In the Which remote IP addresses does this rule apply to? section, select These IP addresses: and click Add.

  6. Add the IP address 100.100.100.200 of the metadata server and click OK.

  7. In the New Outbound Rule Wizard dialog box, click Action and select Allow the connection.

  8. Click Name in the left-side navigation pane. Specify the name of the outbound firewall rule and click Finish.

  9. Change the hostname and restart the instance. If the hostname is updated as expected, the issue is resolved.

Solution 2: Disable the system firewall

  1. Connect to the Windows instance.

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

  2. Open the Windows Defender Firewall with Advanced Security window.

    1. Right-click the Dingtalk_20210510142550.jpg icon and select Run.

    2. Enter wf.msc in the Run dialog box and click OK.

  3. In the Windows Defender Firewall with Advanced Security window, click Windows Defender Firewall Properties.

  4. In the Windows Defender Firewall with Advanced Security on Local Computer Properties dialog box, set Firewall state: to Off and click OK.

  5. Check whether the system firewall is disabled.

  6. Change the hostname and restart the instance. If the hostname is updated as expected, the issue is resolved.