hostname

Use this command to set the network name for the device. OcNOS uses this name in system prompts and default configuration filenames.

Setting a host name using this command also sets the host name in the kernel.

After giving the hostname command, you must write to memory using the terminal monitor command. If you do not write to memory, the change made by this command (the new host name) is not set after the device reboots.

Use the no parameter to disable this function.

Command Syntax

Copy
hostname WORD
no hostname (WORD|)

Parameter

WORD

Network name for a system. Per RFC 952 and RFC 1123, a host name string can contain only the special characters period (“.”) and hyphen (“-”). These special characters cannot be at the start or end of a host name.

Default

None

Command Mode

Configure mode

Applicability

This command was introduced before OcNOS version 1.3.

Example

Copy
#configure terminal
(config)#hostname ABC
(config)#
 
(config)#no hostname
(config)#exit