hostname

Configures a system name for a device and saves the information locally in the configuration file for future reference.
Syntax
hostname string
no hostname
Command Default

The device has a factory-set hostname.

Parameters
string
Configures the system name. The name can be up to 255 alphanumeric characters. The host name should be enclosed in quotation marks if it contains spaces.
Modes

Global configuration mode

Usage Guidelines

When you configure a system name, the name replaces the default system name in the CLI command prompt.

The no form of the command removes the configured hostname.

Examples

The following example configures a system name.

device(config)# hostname headquarters
headquarters(config)#