Questions and Answers — VDSina

How do I change the server's hostname?

How can I change the server's hostname?

16.06.2018 10:00 Employee Misha no comments yet
16.06.2018 10:00
Answers to the question — 1
Employee Misha

The process of changing the hostname depends on the operating system used. For example, to change the hostname in CentOS 7, it is enough to run the following command in the console:

hostnamectl set-hostname new_hostname

instead of new_hostname, set the value you need.

To change the hostname in CentOS 6, open the /etc/sysconfig/network file and enter it in the HOSTNAME field, then run the command:

 hostname new_hostname

instead of new_hostname, set the value you need.

In Debian and Ubuntu, you can change the hostname by opening the /etc/hostname file and entering a new value into it. You can do this by running the following command:

nano /etc/hostname

If the Nano text editor has not been installed on your server before, you can install it as follows:

sudo apt-get install nano

To change the hostname in FreeBSD, set a new value in the /etc/rc.conf and /etc/hosts files

16.06.2018 10:02

To answer you need to register or log in.
Close the window
Authentication
2FA verification
Close the window
Registration
A password will be sent to the specified email address
Close the window
Password Reminder
Close the window
Password Reminder
Close the window
Password Reminder
Exit