Configure the hostname in IOS

You can use the global configuration mode hostname command to configure an IOS device hostname. The hostname you specify is only locally significant, meaning that it doesn’t affect the DNS name resolution process. Generally, it is a good idea to name your device to reflect its physical location.

Here are the steps to change an IOS device’s hostname:

1. Log in to your IOS device and enter the privileged exec mode by entering the enable command. Provide the correct username and password if required:

enter privileged exec mode

2. Enter the global configuration mode by typing the configure terminal command (or the shortcut conf t) in the privileged exec mode:

enter global configuration mode

3. To change the hostname, type the hostname command followed by the name you would like to configure. Notice how the prompt has changed:

hostname command

Hostnames should follow the ARPANET rules. They should start with a letter, end with a letter or digit, contain only letters, digits, and hyphens, and be 63 characters or fewer.
Geek University 2021