How to Set or Change Hostname in CentOS/RHEL 7/8 Leave a Comment / CentOS, Linux / By Admin Stapes 1: # vi /etc/hostname Stapes 2: press i button Stapes 3: Overtight if existing or type your hostname like kir2.carrothost.com after that press the Esc button and type wq! press Enter