On the older SunOS servers, the hostid was based on the MAC address of the primary network interface. By truncating leading zeros your would get 8:0:20:xx:xx:xx displayed by ifconfig.
The hostid starts with the first two octets of the MAC address -- followed by six hexadecimal characters representing the last three octets. Thus, a server with a MAC address of 08:00:20:0a:1b:2c would have a hostid of 800a1b2c. I have a sparcstation with the MAC address of 00:03:ba:ec:3b:11 and a hostid of 83ec3b11.
I believe with the newer servers, this is all being done away with and is supported by a "system configuration card" allowing you to take all of this information from one server to another in the event of a major hardware failure.
Red Hat Enterprise Linux HostID
For RHEL, the hostid command does the following:
- calls gethostname() [i.e. takes the hostname given by the output of the 'hostname' command in the shell]
- Finds the entry in /etc/hosts that corresponds to the ip address of the hostname.
- Copies octets from the ip address and prints them as a hex number:
AA.BB.CC.DD ==> 0x[BB][AA][DD][CC]
Our problem was that there was no entry other than localhost in /etc/hosts
127.0.0.1 saturn.example.com saturn localhost.localdomain localhost
When that happens, the hostid command will always return 007f0100.
I changed /etc/hosts to;
127.0.0.1 localhost.localdomain localhost 184.108.40.206 saturn.example.com saturn
and the output of the hostid command changed to:
190a2936 (not the real number)
Some variations of Unix may read the file /etc/hostid as an option, allowing you to change it at will.