Ad space (banner)
📡Networking Lessons
Lesson 5 / 39

Renaming the Switch with hostname

When you manage several devices and want to tell them apart, use hostname. It is used in configuration mode and sets the name assigned to the device itself.

The syntax is hostname name, inside configuration mode. Once set, the prompt itself displays the new name.

Running hostname CoreSwitch changes the prompt from Switch(config)# to CoreSwitch(config)#, and from then on you can identify the device by that hostname.

A common stumble is leaving every device on the same default hostname (such as Switch) and losing track of which terminal you are logged into.

In real work, setting a hostname that reflects the site or role (core switch, floor switch, and so on) is one of the first standard steps in building a network.

Networking
Try it (type this into the pseudo terminal)
hostname CoreSwitch

🧑‍💻 You can type this command into the Networking pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)