Basic config

hostname <name>

Rename the device. The prompt updates immediately.

Works on: Router, SwitchMode: config

Example

Router(config)# hostname R1
R1(config)#
Run this command live

Don't just read it — type hostname <name> in a real network simulator in your browser and watch it take effect. No install, no account needed to start.

Open the lab

Frequently asked

What does the "hostname <name>" command do?

Rename the device. The prompt updates immediately.

Example of "hostname <name>"

Router(config)# hostname R1 R1(config)#

More Basic config commands

← Back to the full command reference

hostname <name> — network CLI command reference · NetForge-AI