You can modify the instance name, hostname, and description of an Elastic Compute Service (ECS) instance to organize and identify your instance resources.
| Attribute | Takes effect | Restart required |
|---|---|---|
| Instance name | Immediately | No |
| Description | Immediately | No |
| Hostname | Immediately in the console; after restart at the OS level | Yes (restart through the ECS console or API only) |
Prerequisites
Before you begin, make sure that you have:
An ECS instance
Permissions to modify instance attributes
Modify instance attributes in the ECS console
Open the ECS console.
In the top navigation bar, select the region and resource group of the instance.

Click the instance ID to open its details. On the Instance Details tab, click All Actions in the upper-right corner, then search for and click Modify Instance Attribute.
In the Modify Instance Attributes dialog box, update the attributes and click Confirm.
NoteThe hostname of a Windows instance cannot exceed 15 characters. If you plan to replace the operating system from Linux to Windows, make sure the hostname meets this requirement before the replacement.
(Conditional) If you changed the hostname, restart the instance from the ECS console or by calling the
RebootInstanceoperation.WarningThe restart operation stops the instance for a short period of time and may interrupt services that are running on the instance. We recommend that you restart the instance during off-peak hours.
ImportantRestarting the instance from within the operating system does not apply the new hostname. Restart through the ECS console or the
RebootInstanceAPI.
API reference
Use these API operations to query or modify instance attributes programmatically:
| Operation | Description |
|---|---|
DescribeInstanceAttribute | Query the attributes of an ECS instance |
ModifyInstanceAttribute | Change the InstanceName, HostName, or Description of an existing instance |
RunInstances | Set InstanceName, HostName, and Description when creating an instance |