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
 
Recommended Threads
Replies
5
Views
4,220
Replies
4
Views
2,505
Replies
6
Views
2,353

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