Oracle Linux 7 修改 hostname
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,Linux修改hostname的常用操作方法是--手工在/etc/sysconfig/network中追加"HOSTNAME=xxxxx"并重启系统,这个方法在Oracle Linux 7中是不生效的
千家信息网最后更新 2026年11月02日Oracle Linux 7 修改 hostnameLinux修改hostname的常用操作方法是--手工在/etc/sysconfig/network中追加"HOSTNAME=xxxxx"并重启系统,这个方法在Oracle Linux 7中是不生效的。
那么在Oracle Linux 7中怎么配置hostname?
来源于:
How to Configure hostname in Oracle Linux 7 (Doc ID 2049221.1)
解决方案:
请使用如下三种方法的任意一种来修改Oracle Linux 7中的主机名
1. use hostname control utility: hsotnamectl
2. use NetworkManager command line tool: nmcli
3. edit /etc/hostname file directly (a reboot afterwards is required)
Static hostname: localhost.localdomain
Operating System: Oracle Linux Server 7.1
CPE OS Name: cpe:/o:oracle:linux:7:1
Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64
Architecture: x86_64
[root@localhost ~]#
Static hostname: oraclelinux.oracle.com
Operating System: Oracle Linux Server 7.1
CPE OS Name: cpe:/o:oracle:linux:7:1
Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64
Architecture: x86_64
localhost.localdomain
[root@localhost ~]# systemctl restart systemd-hostnamed
oraclelinux.oracle.com
localhost.localdomain
[root@localhost ~]# cat /etc/hostname
oraclelinux.oracle.com
oraclelinux.oracle.com
那么在Oracle Linux 7中怎么配置hostname?
来源于:
How to Configure hostname in Oracle Linux 7 (Doc ID 2049221.1)
解决方案:
请使用如下三种方法的任意一种来修改Oracle Linux 7中的主机名
1. use hostname control utility: hsotnamectl
2. use NetworkManager command line tool: nmcli
3. edit /etc/hostname file directly (a reboot afterwards is required)
1. Use hsotnamectl which is a command-line client to systemd-hostnamed service
Get current hostname status:
Static hostname: localhost.localdomain
Operating System: Oracle Linux Server 7.1
CPE OS Name: cpe:/o:oracle:linux:7:1
Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64
Architecture: x86_64
Set hostname:
[root@localhost ~]#
Re-login terminal session:
Static hostname: oraclelinux.oracle.com
Operating System: Oracle Linux Server 7.1
CPE OS Name: cpe:/o:oracle:linux:7:1
Kernel: Linux 3.8.13-55.1.6.el7uek.x86_64
Architecture: x86_64
2. nmcli
Check current hostname:
localhost.localdomain
Modify hostname and restart ystemd-hostnamed service:
[root@localhost ~]# systemctl restart systemd-hostnamed
Re-login terminal session:
oraclelinux.oracle.com
3. Edit /etc/hostname
View current content:
localhost.localdomain
Replace file content with new hostname:
[root@localhost ~]# cat /etc/hostname
oraclelinux.oracle.com
Restart system and verify:
oraclelinux.oracle.com
方法
主机
常用
手工
方案
来源
系统
解决方案
配置
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
广东猪兼强互联网科技有限公司
互联网科技网
涨乐互联网科技
科技互联网技术
网络科技有限互联网
中国 科技 互联网
广州凡科互联网科技
居家互联网科技有限公司
互联网科技公司需要的职位
语蝶互联网科技有限公司
华夏互联网科技业
朱啸虎曾投资哪些互联网科技企业
国大互联网教育科技有限公司薪资
美国互联网科技实力
富国互联网金融科技混合基金
上海创道互联网络科技有限公司
绵阳真晨互联网科技有限公司
青岛易易互联网科技
山东亿川互联网科技有限责任公司
如何强化互联网金融科技
极限挑战互联网科技
哈尔滨秒房互联网科技有限公司
互联网教育科技公司vipkid
允成互联网科技有限公司融资
高科技互联网套路
厦门江牛科技互联网
宇信科技在杭州互联网排第几
卡尔迅互联网科技有限公司
江苏互联网科技小贷
玉溪新华互联网科技怎么选