---
title: Device Configuration
slug: routing/device-configuration
createdAt: 2025-12-04T04:32:02.396Z
---

## <font color="#1d50a2">Device Configuration</font>

### <font color="#1d50a2">hostname</font>

**\[Command]**
**hostname *hostname***

**\[Purpose]**
Modify the device host name

**\[Parameter]**

| **Parameter** | **Description** |
| ------------- | --------------- |
| *hostname*    | Host name       |

**\[View]**
System view

**\[Notes]**
The hostname can be named with a maximum of 64 characters and can only contain "." , "-", "a-z", "A-Z" and "0-9".

It cannot start and end with ".", "-", and ".." cannot appear. After modification, you need to save the configuration manually and log out to take effect again.

**\[Use Cases]**

```plaintext
sonic# hostname sonic-226
```

