Home Linux ServerLinux Fundementals Command to change hostname on CentOS server

Command to change hostname on CentOS server

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

In today’s article, AZDIGI will guide you to change the hostname on a Linux server using CentOS operating system. To change, you need to SSH into the server and do the following.

Check hostname

To check the current hostname, use the following command:

# hostname

Change hostname temporarily

The temporary hostname change will be lost if you reboot the server.

# hostname huongdan.dotrungquan.info
Remember to change the hostname in the instructions to the hostname you need.

Change hostname permanently

To change the hostname permanently, run the following command:

# hostnamectl set-hostname help.dotrungquan.info
Xshell vhJcXWewNs

Then you check the status with the hostnamectl command, you will see the following information

Xshell jyPhWC9i12

So you have finished changing the hostname on the CentOS server already!

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign