CentOS 호스트 이름 변경

원본 링크:http://www.cnblogs.com/walkman-sky/p/9004101.html
centos 호스트 이름 을 수정 하 는 올 바른 방법
1 centos 6 에서 hostname 수정
[root@centos6 ~]$ hostname                                              #      hostnmae
centos6.picker.com
[root@centos6 ~]$ vim /etc/sysconfig/network                            #   network    hostname (    )
[root@centos6 ~]$ cat /etc/sysconfig/network                            #     
NETWORKING=yes
HOSTNAME=centos66.picker.com
[root@centos6 ~]$ hostname centos66.picker.com                          #      hostname(    )
[root@centos6 ~]$ vim /etc/hosts                                        #   hosts  , 127.0.0.1  hostname
[root@centos6 ~]$ cat /etc/hosts                                        #   
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 centos66.picker.com
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

2 centos 7 호스트 이름 수정
[root@centos7 ~]$ hostnamectl set-hostname centos77.picker.com             #                  
[root@centos7 ~]$ hostname                                                 #    
centos77.picker.com
[root@centos7 ~]$ vim /etc/hosts                                           #    hosts  ,  127.0.0.1  hostname
[root@centos7 ~]$ cat /etc/hosts                                           #   
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 centos77.picker.com
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

다음으로 전송:https://www.cnblogs.com/walkman-sky/p/9004101.html

좋은 웹페이지 즐겨찾기