This topic describes solutions for an issue where the hostname of a Windows instance reverts to its previous name after you change the hostname and restart the instance.
Problem description
After you change the hostname of a Windows instance and restart the instance, the hostname reverts to its previous name.
Cause
This issue may be caused by a firewall policy that blocks the instance's access to MetaServer, which results in an abnormal hostname (HostName) update.
Solutions
To resolve this issue, add an outbound firewall rule or disable the system firewall to allow the instance to access MetaServer.
Solution 1: Add an outbound firewall rule
Connect to the Windows instance.
For more information, see Log on to a Windows instance using Workbench (RDP).
Open the Windows Defender Firewall with Advanced Security window.
Right-click the
icon and click Run.In the Run dialog box, enter
wf.mscand click OK.
In the Windows Defender Firewall with Advanced Security window, click Outbound Rules, and then click New Rule.
In the New Outbound Rule Wizard, select Custom, and then click Scope.
In the Which Remote IP addresses does this rule apply to? section, select These IP addresses and click Add.
Enter the MetaServer IP address
100.100.100.200and click OK.In the New Outbound Rule Wizard window, click Action, and then select Allow the connection.
Enter a Name for the new outbound rule, click Finish, and confirm that the rule is created.
Change the hostname again. If the hostname updates correctly after a restart, the issue is resolved.
Solution 2: Disable the system firewall
Connect to the Windows instance.
For more information, see Log on to a Windows instance using Workbench (RDP).
You can open the Windows Defender Firewall With Advanced Security window.
Right-click the
icon and click Run.In the Run dialog box, enter
wf.mscand then click OK.
In the Windows Defender Firewall with Advanced Security window, click Windows Defender Firewall Properties.
In the Windows Defender Firewall with Advanced Security on Local Computer dialog box, set Firewall state to Off and click OK.
Confirm the firewall status.
Change the hostname again. If the hostname updates correctly after a restart, the issue is resolved.