Hostname changed after reboot


I first have to say that I am totally new to Linux and have used it a couple of times only. Yet I have to use it in the future. I am running openSUSE 12.3.

I have a strange thing that happened:

  • After an installation without error, I installed Matlab. That too without issue. I have the parallel computing toolbox and start it using the locale configuration, it finds the 8 cores and everything is fine, I can run my program.
  • Now, there has been an electrical failure in the city that caused the desktop to stop functioning. I restarted the computer and realized that the hostname of the machine has changed ! It was eco-pai04 before the failure and is now linux-kcz8. If that wasn’t enough, now Matlab does not work correctly.
  • Thinking I had been hacked or anything, I deleted the openSUSE partition and made a clean install again. Matlab works fine, hostname is back to eco-pai04.
  • I shut down the computer and reboot it one day later, hostname has changed again…
  • I have tried many things: start openSUSE in failsafe mode, with advanced options, run the memory test. Nothing has changed since and the hostname remains

When I type


in the terminal, it gives me

. Also, I am normally a root user, as I understand, since I created the account. However, I cannot read/write in the root folder and had to install Matlab in another folder than the normal one proposed on installation since I didn’t have the permission to do so.

I have to admit that I am a bit lost and I want to avoid having to delete the partition again to reinstall everything. Plus, I fear that this happens in the future. Do any of you have any idea of any solution for me ?

Thank you very much for your help,


Something like “” is the standard hostname after a fresh installation (that “kcz8” part is created randomly).
You can change the hostname in YaST->Network->Network Settings->Hostname/DNS.
If you enable “Change hostname via DHCP” your hostname will be fetched from your Server/Router, I think that’s what you are expecting.

As to your other question:
Normally you shouldn’t be the root user. And since you can’t write to the root folder, you don’t seem to be.
You can type “whoami” in a terminal window to check. If you’re using KDE, your current username is shown in the startmenu, right at the top.

To run things as root (to install a program f.e.), use “sudo” or “kdesu”.

Within YAST, open and inspect your Network Device properties.
You will find a checkbox setting to change your machine name to whatever DHCP wants. Make sure this is disabled so your manual settings are effective.

Also, while you’re in YAST make sure <all> the places where the hostname is declared, make sure it’s whatever you want.
Then exit the Network Devices applet and still within YAST, open and inspect, possibly edit the Hosts file so your machine name is consistent.

After all that, just to be sure that any changes are consistently applied, flush your nameserver cache

nscd restart

If you are logged into centralized network security like LDAP or Active Directory or something else, you may also need to make changes on the Authentication Server.


Sorry, “nscd restart” doesn’t work on openSUSE.

This should work

nscd -K && nscd


It would be “rcnscd restart” or “systemctl restart nscd”.
But this shouldn’t be necessary I think.