Get the App
SLTechnology News&Howtos  ›  Servers  › 

Modify hostname in Linux system

Shulou Source: shulou.com Published: 2022-06-03 03:25:56 09月22日 Update

Modify the host name in the Linux system 1. Use the hostname command

The hostname command can only temporarily change our hostname, which will revert to the original hostname when we restart it.

[root@server ~] # hostname server1 [root@server ~] # uname-nserver1# use the uname-n command to view the modified hostname and modify the configuration file

You can permanently modify your hostname by modifying the / etc/sysconfig/network file

[root@client1 ~] # vim / etc/sysconfig/networkNETWORKING=yesHOSTNAME=client#client is the modified hostname

Tags: Host command file system permanent configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information NVidia Xiaomi Redmi Microsoft