0

How do i set the hostname of the machine (Suse 9.2/9.3) ? the hosts file in /etc/hosts shows a different hostname. where is the setting else stored other than in the /etc/hosts file ? changing the /etc/hosts file did not effect the name of the hostmachine (PS1).

this link was no help: /etc/hosts , /etc/sysconfig/network and hostname?

  • 1
    The docs aren't even online anymore for a distro that old. You could try looking around in YaST, I suppose. – Michael Hampton May 30 '19 at 19:04
  • I think on old suse systems the file is `/etc/HOSTNAME`. In any case, yast ought to know how to do it, because setting the host name is one of the things it was designed to do. – Mark Plotnick Jun 01 '19 at 22:38

2 Answers2

2

I'm not a Suse guy myself, but have you updated /etc/hostname? Also, in most Linux distributions you'll need to reboot in order to update the hostname system-wide.

(Yes, I know that technically you don't need to reboot, but it's often the best way to make sure the change actually sticks)

Joel C
  • 166
  • 6
  • there is no hostname file in /etc/sysconfig/network directory. neither are there /etc/nodename nor /etc/hostname. – McErroneous May 30 '19 at 19:42
1

in /etc/sysconfig/network you should have a hostname= variable & depending on the OS, you might also have an /etc/nodename or /etc/hostname (i believe it's this one in Suse) then if your /etc/hosts is good, reboot your host and you should be good

olivierg
  • 524
  • 2
  • 8
  • 27
  • there is no hostname file in /etc/sysconfig/network directory. neither are there /etc/nodename nor /etc/hostname. – McErroneous May 30 '19 at 19:39