fedora修改主机名
Different Linux distros have different method to set the hostname. On Fedora Linux, it is quite simple.
不同的Linux发行版具有不同的设置主机名的方法。 在Fedora Linux上 ,这非常简单。
在较新的Fedora版本中∞ (On newer Fedora releases ∞)
At least from Fedora 19 (sorry, no sure the exact earliest version):
至少从Fedora 19起(抱歉,不确定确切的最早版本):
You need to edit the file /etc/hostname
which just contains the hostname.
您需要编辑仅包含主机名的文件/etc/hostname
hostname。
在较旧的Fedora版本中∞ (On older Fedora releases ∞)
Sorry, I do not know the exact version till which you need to use the above method. At least from Fedora 12 to Fedora 17, you need to use this method.
抱歉,我不知道需要使用上述方法的确切版本。 至少从Fedora 12到Fedora 17,您需要使用此方法。
On Fedora, you need to use this method.
在Fedora上,您需要使用此方法。
Open the /etc/sysconfig/network
file
打开/etc/sysconfig/ network
文件
# vim /etc/sysconfig/network
Find the line starting with
查找以以下内容开头的行
HOSTNAME=
Assign the hostname for this computer to this variable. For example, to set the hostname to ericpc.systutorials.com, just set
将此计算机的主机名分配给该变量。 例如,要将主机名设置为ericpc.systutorials.com,只需设置
HOSTNAME=ericpc.systutorials.com
Save the file and it should take effect. If the machine uses the network service, restarting the network may be needed:
保存文件,它应该会生效。 如果机器使用网络服务,则可能需要重新启动网络:
# service network restart
翻译自: https://www.systutorials.com/changing-hostname-of-fedora-linux/
fedora修改主机名