题:修改主机名为 server0.example.com

方法1、命令行修改主机名

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

# hostnamectl set-hostname server0.example.com

 

方法2、创建文件永久修改主机名

# vi /etc/hostname

server0.example.com

 

方法3、修改hosts文件

# vi /etc/hosts

127.0.0.1 server0.example.com localhost 

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄