Skip to content
Ask AI

Device Configuration

[Command] hostnamehostname

[Purpose] Modify the device host name

[Parameter]

ParameterDescription
hostnameHost 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]

sonic# hostname sonic-226