OpenSUSE Linux Change Hostname (computer name) command

To change the hostname of an OpenSUSE Linux system, follow these steps:

  1. Edit the hostname file:

     
    sudo nano /etc/hostname
  2. Replace the existing hostname with the desired one and save the file.

  3. Update the /etc/hosts file to reflect the new hostname:

     
    sudo nano /etc/hosts
  4. Change the hostname in the line starting with 127.0.0.1 to the new hostname.

  5. Save the changes to the file and exit the editor.

  6. Restart the network service to apply the changes:

     
    sudo systemctl restart network.service
  7. Verify that the hostname has been updated by using the following command:

     
    hostname

After these steps, your OpenSUSE Linux system should have the new hostname you specified.

Leave a Comment