How to change a server's hostname in CentOS

Aaron Lavers

Member
Registered
Joined
May 20, 2016
Messages
61
Points
8
Using a text editor like nano

Code:
sudo nano /etc/sysconfig/network
Modify the HOSTNAME= value to match your FQDN hostname.

Code:
HOSTNAME=yoruserver.domain.com
For internal networking, find at at /etc/hosts to change the host that is associated with the main IP address for your server

Code:
127.0.0.1      localhost localhost.localdomain
123.25.57.79   yoruserver.domain.com   hostname
Restart networking on your server to ensure that changes will be affected
Code:
/etc/init.d/network restart
 
Latest Threads
Replies
0
Views
57
Replies
1
Views
33
Replies
0
Views
112
Replies
2
Views
135
Recommended Threads
Replies
1
Views
2,613
Replies
5
Views
2,241
Replies
25
Views
11,658
Replies
1
Views
954

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top