Change hostname of linux server

By default, your server is started with the server’s given name as the hostname. Some software, such as cPanel, requires a valid Fully Qualified Domain Name (FQDN) for the hostname to be used during their licensing verification system.

Follow the steps to change the hostname of server
- Login as root to server and open the below file

# sudo nano /etc/sysconfig/network

- Modify the HOSTNAME=”your hostname of server” , the given value should be in FQDN. Ex: server1.example.com

HOSTNAME=server1.example.com

- For internal networking, change the host that is associated with the main IP address for your server, you can do it in this file /etc/hosts

127.0.0.1      localhost localhost.localdomain
123.45.67.89   server1.example.com   hostname

- Run the hostname command. This command lets you change the hostname on the server that the command line remembers, but it does not actively update all programs that are running under the old hostname.

# hostname server1.example.com

# hostname
server1.example.com

- Restart networking on your server to ensure that changes will persist on restart.
# /etc/init.d/network restart

  • 2 Пользователи нашли это полезным
Помог ли вам данный ответ?

Связанные статьи

Dedicated Servers

Dedicated server is a type of remote server that is entirely dedicated to an individual,...

Update rDNS

You can update the Reverse DNS for server IP by using your client area, We have developed a User...

RAID levels

RAID (Redudnat Array of Independent Disks) is a way of storing the same data in different places...

How to assign multiple IP addresses to one network interface on CentOS

The practice of configuring multiple IP addresses on a particular network interface is called IP...

Features of Dedicated servers

ScopeHosts dedicated servers provides you ulitmate power, security and control, you will get full...