HostOnNet Blog

Tag Archives: hostname

Setting hostname On CentOS 7 Server

CentOS 7 come with a command hostnamectl to query and change the system hostname and related settings. Set hostname To set hostname, run Example [root@localhost ~]# hostnamectl set-hostname server2.hosthat.com [root@localhost ~]# hostname server2.hosthat.com [root@localhost ~]# See also HostName


Changing computer name in ubuntu

To change computer name in ubuntu, run sudo echo “computer-new-name” > /etc/hostname Now you need to reboot to get the computer name changed.


Setting HostName in Linux

To set host name on a CentOS/RHEL/Fedora Server to serverX.hosthat.com Edit /etc/sysconfig/network Find Replace With Edit /etc/hosts Add To find servers main IP, use ifconfig, it should be IP of eth0 in most cases. Add hostname to /etc/hostname Setting HostName