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修改主機名