在CentOS Redhat里设置FQDN和Hostname
2013-12-15 13:59
405 查看
http://extr3metech.wordpress.com/2012/12/12/changing-hostname-in-centos-red-hat-linux/
http://www.chenshake.com/linux-foundation-set-fqdn-hostname/
To change host name in Linux from command line, type:
vi /etc/sysconfig/network
Now, you will see a file such as the one shown below:
To change the hostname , you can change the highlighted to any thing you want. Press ‘i‘ or INSERT to edit the file. After making necessary changes, you can save the file by pressing ESC followed by :wq and hit ENTER.
Now, restart to make necessary changes. You can reboot by typing the following in the command line:
reboot
After reboot, login and check your hostname by typing the following in the terminal / command line :
hostname
Hope this helps!
现在对于Puppet,也是必须设置完整的FQDN 名字。不同的操作系统,有有点不一样。
CentOS
查看
编辑 /etc/sysconfig/network ,你需要加入一行,记住HOSTNAME,必须大写。
http://www.chenshake.com/linux-foundation-set-fqdn-hostname/
To change host name in Linux from command line, type:
vi /etc/sysconfig/network
Now, you will see a file such as the one shown below:
To change the hostname , you can change the highlighted to any thing you want. Press ‘i‘ or INSERT to edit the file. After making necessary changes, you can save the file by pressing ESC followed by :wq and hit ENTER.
Now, restart to make necessary changes. You can reboot by typing the following in the command line:
reboot
After reboot, login and check your hostname by typing the following in the terminal / command line :
hostname
Hope this helps!
现在对于Puppet,也是必须设置完整的FQDN 名字。不同的操作系统,有有点不一样。
CentOS
查看
[root@rdo ~]# hostname rdo [root@rdo ~]# hostname -f rdo.test.com要实现这个效果,需要修改两个文件
编辑 /etc/sysconfig/network ,你需要加入一行,记住HOSTNAME,必须大写。
# cat /etc/sysconfig/network NETWORKING=yes HOSTNAME=rdo编辑 /etc/hosts,增加一行
192.168.178.2 rdo.test.com rdo退出ssh,再登陆,就应该生效。
相关文章推荐
- centos设置fqdn(全称域名)和hostname的方法
- centos/redhat/fedora 7 设置默认开机启动模式
- centos7下hostname的设置
- redhat 6设置CentOS的yum源
- CentOs 设置IP/HostName 方法
- centos 下SAMBA设置的共享无法写入的解决办法 redhat应该也一样
- redhat 6及centos5.6加载光驱并设置更新源yum
- 【Centos7】hostnamectl 设置主机名
- centos/redhat 7日志设置
- [CentOS]如何设置hostname
- Linux (Redhat / Fedora / CentOS) 更改 hostname 的方式
- [CentOS]如何设置hostname
- Redhat/CentOS/Fedora下IPv6地址的静态配置和静态默认网关设置
- redhat 6设置CentOS的yum源
- CentOS 下,设置IP DNS Hostname
- VMware虚拟机中CentOS/redhat设置固定IP
- CentOS设置和查看hostname
- VMware虚拟机中CentOS/redhat设置固定IP
- VMware虚拟机中CentOS/redhat设置固定IP
- redhat 6设置CentOS的yum源