Skip to content
Skip to main content

About this free course

Download this course

Share this free course

Discovering computer networks: hands on in the Open Networking Lab
Discovering computer networks: hands on in the Open Networking Lab

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

10.3 Configure a hostname

You will now have an opportunity to configure a hostname on the router. The main reason for configuring a hostname on a device is to easily identify the device when accessing it remotely. For example, if you are working from an office in Milton Keynes but you are configuring a router physically located in London, the only reference you have via the command line is the hostname. It is possible that you could be connected to multiple routers at the same time, so it is important to establish the correct and identifiable hostname before you change the configuration of the device.

Watch the video below (which is about 2 minutes long) to see how to configure a hostname on a router.

Box _unit6.2.3 Add a hostname

Download this video clip.Video player: 61_add_a_hostname.mp4
Copy this transcript to the clipboard
Print this transcript
Show transcript|Hide transcript
Interactive feature not available in single page view (see it in standard view).

It is highly recommended to set a hostname on every router or switch. You need to be aware that there are rules for hostnames. For example, a hostname must not exceed 63 characters. It must start and end with a letter or digit, and contain only letters, digits, or hyphens.

Activity _unit6.2.3 Activity 3 Try it out

5 minutes

Open PT Anywhere [Tip: hold Ctrl and click a link to open it in a new tab. (Hide tip)] in a new tab or window so you can read these instructions.

  1. Select the router, open the CLI tab, then go to the appropriate configuration mode to configure a hostname.
  2. Configure the hostname ‘Coventry’ on the device and save the configuration.


You should have used the command enable to enter the privileged exec mode, and then the command configure terminal to enter global configuration mode. The next step was to enter the command hostname Coventry. Following this you should have noticed the prompt change from Router (config)# to Coventry (config)#. To save the change you should have entered the command exit to return to privileged exec mode and then used the command copy running-config startup-config.

You’ve now used the commands in the CLI to configure a hostname on a router. Now you know which router you are connected to, you can start making configuration changes. The next section will explain how to set an IP address on a router.