How permanently change hostname in Linux?

Ngọc Trâm

New member
How permanently change hostname in Linux?
Answer
Ubuntu 18.04 LTS change hostname permanently
  1. Type the hostnamectl command : sudo hostnamectl set-hostname newNameHere. Delete the old name and setup new name.
  2. Next Edit the /etc/hosts file: sudo nano /etc/hosts. …
  3. Reboot the system to changes take effect: sudo reboot.
 

Tìm kiếm

Back
Top