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.

Complementary video guide:

Change system hostname in openSUSE and SLES:

  1. Open the Terminal application.
  2. Check current hostname.
    user@linux-ui1m:~> hostname

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

  3. Change the hostname using hostnamectl.
    user@linux-ui1m:~> sudo hostnamectl set-hostname host
    [sudo] password for root:
  4. Check hostname again to confirm.
    user@linux-ui1m:~> 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.
    user@linux-ui1m:~> bash

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.