Run the # uname-ncsdba # hostnamecsdba1 command to modify the linux host name and view the host name. Run the hostname command. Command Format: hostname newhostname this command is used to temporarily modify the linux host name. Its survival time is the current linux running time, that is, the running time before the restart. It usually takes effect after modification, but it cannot be modified permanently. 2. It can be modified through the configuration file/etc/sysconfig/network. ------------------------------------------------------ # Cat/etc/sysconfig/networkNETWORKING = yesHOSTNAME = localhost. localdomain ------------------------------------------------------ by modifying the content of this file, it can permanently modify the linux host name, but it does not take effect immediately, that is, it may not take effect at the current running time, that is, it takes effect only after the next restart, at least not in the current session, and takes effect only after the user exits. By modifying this configuration file and using the hostname command, you can immediately and permanently modify the linux host name. 3. file/etc/hosts function. The function of this file is to provide a comparison between the ip address and the host name. linux uses this file to know that an ip address corresponds to a host name, for example, if the ip address of google is 10.23.56.238, you can add a line at the end of the file: 10.23.56.238 google.com, which corresponds to a row. The format of each line is: what is the role of this file to store the Host Name and ip address of the Local Machine? Some software uses this file to implement the correspondence between host names and ip addresses, such as oracle. This file provides settings for your local machine, which is similar to right-clicking on my computer in windows, setting properties, and setting the host name in the computer name.