hostname

Syntax

hostname <HOSTNAME>

no hostname [<HOSTNAME>]

Description

Configures the host name of the switch.

The no form of this command sets the host name to the default value, which is switch.

Command context

config

Parameters

<HOSTNAME>

Specifies the host name to be assigned to the switch. The first character of the host name must be a letter or a number. Maximum string length: 32. Default: switch

Authority

Administrators

Usage

Specifies the host name of the switch. The host name is displayed in the CLI prompt.

Examples

Setting and showing the host name:

switch# show hostname
switch
switch# configure terminal
switch(config)# hostname myswitch
myswitch(config)# do show hostname
myswitch
myswitch(config)# 
Setting the host name to the default value:
myswitch(config)# no hostname
switch(config)#