VPSMATE

  • HOME
  • NEWS
  • VPS
  • DEDICATED
  • ARCHIVES
  • GoDaddy
  • SCRIPT
  • TOOLS
    • Traceroute
    • Benchmark
    • Useful Sites
  • Themes
  • GFW
VPSMATE
VPS COUPON & PROMOS | VPS & DEDICATED SERVERS OFFERS | VPS REVIEWS
  1. Main page
  2. Tips
  3. Main content

Change Hostname in CentOS 6.5/7

10/07/2014 104hotness 0likes 0comments

vpsmate_centos7

CentOS 6.5

[1] Change hostname with a commnad (but if rebooting, it will be back).

[root@vpsmate ~]# hostname 				# show current hostname
srv1.vpsmate.net
[root@vpsmate ~]# hostname srv2.vpsmate.net 		# change hostname
[root@vpsmate ~]# hostname 
srv2.vpsmate.net

[2] Change hostname permanently.

[root@vpsmate ~]# vi /etc/sysconfig/network		# change
HOSTNAME=srv2.vpsmate.net
[root@vpsmate ~]# exit
CentOS release 6.5
Kernel xxx
srv2.vpsmate.net login: 				# changed

 

CentOS 7

[1]Change hostname with a commnad (but if rebooting, it will be back).

[root@vpsmate ~]# hostname 					# show current hostname
srv1.vpsmate.net
[root@vpsmate ~]# hostname srv2.vpsmate.net 		# change hostname
[root@vpsmate ~]# hostname 
srv2.vpsmate.net

[2] Change hostname permanently.

[root@vpsmate ~]# vi /etc/hostname			# change
srv1.vpsmate.net
[root@vpsmate ~]# exit
CentOS Linux 7
Kernel 3.10.0-123.4.2.el7.x86_64 on an x86_64
srv1 login: 						# just changed

 

 

 

Related

Tag: Nothing
Last updated:10/07/2014

kyaky

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

Comments

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
Cancel

COPYRIGHT © 2021 vpsmate.net. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang