CentOS7 modify hostname (use with self-built dns)

vi /etc/hosts

Original content:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

Add the host name at the back, if the host name is git.abc.tech, modify it to

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 git.abc.tech
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6 git.abc.tech

vi /etc/hostname

Original content:

localhost.localdomain

Modify to host name

git.abc.tech

rebootRestart the host

Use to hostname hostnamectlcheck the modified results after booting

How to make the history command display the date and time

Guess you like

Origin blog.csdn.net/sxhexin/article/details/105700704