The hostname of a device is its identification. A router or switch must have its identity established to be accessible on the network to other devices.
The name value must be less than 256 characters. To set the hostname using a configuration :-
root# set system host-name Router-1
root# commit
Router-1 #