วิธีเปลี่ยน hostname บน CentOS 7 และ RHEL 7 nmtui command

You can set host name using nmtui command which has text user interface for new users:
# nmtui
Sample outputs:

Fig.01: Use nmtui to set hostname on a CentOS 7

Fig.01: Use nmtui to set hostname on a CentOS 7


Use the Down arrow key > select the “Set system hostname” menu option > Press the “Ok” button:

Fig.02: Set hostname

Fig.02: Set hostname


You will see the confirmation box as follows:

Fig.03: New hostname confirmed

Fig.03: New hostname confirmed


Finally, restart hostnamed service by typing the following command
# systemctl restart systemd-hostnamed
To verify changes, enter:
# hostnamectl status
Sample outputs:

Fig.04: CentOS 7 / RHEL View Host Name Details Using hostnamectl Command

Fig.04: CentOS 7 / RHEL View Host Name Details Using hostnamectl Command

 

บทความจาก cyberciti.biz

  • CentOS 7
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

วิธีเปลี่ยน hostname บน CentOS 7 และ RHEL 7 ด้วย hostnamectl

โดยการใช้คำสั่ง hostnamectl การใช้งานคำสั่งนี้ก็ง่ายมาก ถ้าต้องการดู hostname ก็ใช้คำสั่ง...

วิธีเปลี่ยน HostName ใน RHEL และ CentOS 6.X

ก่อนเปลี่ยนแปลงแนะนำให้ตรวจสอบสถานะ hostname ปัจจุบันก่อนครับด้วยคำสั่ง hostname  ...

วิธีแก้ IP บนเซิร์ฟเวอร์ RHEL / CentOS 7 ด้วย nmtui

nmtui (Network Manager Text user interface) is a command line program available in RHEL/CentOS 7...

วิธี ตั้งค่า TUI Firewall CentOS 7 และ RHEL 7

To setup TUI Firewall settings in CentOS 7, follow the steps below:-   First go to...

CentOS / RHEL 7 : How to reinstall GRUB2 from rescue mode

Booting into rescue mode and reinstalling GRUB2 1. Boot from the RHEL7 installation DVD by...