openSUSE and SLES will assign random hostname to the system if not configured. It starts with linux- followed by 4 randomised characters.

You can change the hostname for your SUSE system by using hostnamectl program at the terminal.

Step-by-step video guide:

Steps to change system hostname in openSUSE and SLES:

  1. Open the Terminal application.
  2. Check current hostname.
    [email protected]:~> hostname

    hostname is normally displayed in at the shell prompt via \h in the $PS1 environment variable.

  3. Change the hostname using hostnamectl.
    [email protected]:~> sudo hostnamectl set-hostname host
    [sudo] password for root:
  4. Check hostname again to confirm.
    [email protected]:~> hostname

    The shell prompt is not immediately updated as $PS1 is only set when a new shell is started

  5. Start a new shell to test.
    [email protected]:~> bash
    [email protected]:~>

Guide compatibility:

Operating System
openSUSE Tumbleweed
openSUSE Leap 15.1
openSUSE Leap 15.0
SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12
Discuss the article:

Comment anonymously. Login not required.