Javatpoint Logo
Javatpoint Logo

Linux hostname

With the help of hostname command you can set and view hostname of the system.


Linux Hostname1

Look at the above snapshot, our hostname is JavaTpoint.

Setting hostname

Using hostname command you can set it on the system.



Linux Hostname2

Look at the above snapshot, we have set as our hostname.

The above hostname is not permanent. Hostname set with command hostname are not permanent. On rebooting the system, hostname will change to the one that is specified in hostname file.

To set hostname permanently you have to save it in hostname file present on the server. After setting you have to reboot the box.

For Ubuntu, /etc/hostname file is used.

For RHEL, /etc/sysconfig/network is used.

Next TopicLinux curl & wget

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA