In order to change the hostname of the router or switch following are the commands that we need to run. Switch>ena Switch#cont t Switch(config)# hostname MySwitch Switch(config)# end