[NTLUG:Discuss] Host ID
Steve Baker
sjbaker1 at airmail.net
Tue Jun 18 02:14:23 CDT 2002
OK - I figured out what the 'hostid' command does.
It takes the Internet address of the machine (not the 6 byte NIC address)
and swizzles the bytes around.
On my machine for example:
> hostid -v
Hostid is 2831155970 (0xa8c00302)
...well, that machine is 192.168.2.3 on my local network. Converting
those four numbers to Hex yields:
C0 A8 02 03
...which is an anagram of...
A8 C0 03 02 (Network order?)
...which is the hex output from hostid.
So, using 'hostid' to register software isn't a good idea since anyone
can give their machine pretty much any number they like once it's on
a private network.
This probably explains why so many of us have identical hostid numbers.
In fact, you can set your hostid to be anything you like. The 'man' page
for hostid (Under SuSE 7.2) says:
SYNTAX
hostid [-v] [decimal-id]
DESCRIPTION
The hostid command prints the current host id number in
hexadecimal and both decimal and hexadecimal in parenthe
sis if the -v option is given. This numeric value is
expected to be unique across all hosts and is normally set
to resemble the host's Internet address.
Only the super-user can set the hostid by giving an argu
ment. This value is stored in the file /etc/hostid and
need only be performed once.
----------------------------- Steve Baker -------------------------------
Mail : <sjbaker1 at airmail.net> WorkMail: <sjbaker at link.com>
URLs : http://www.sjbaker.org
http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net
http://prettypoly.sf.net http://freeglut.sf.net
http://toobular.sf.net http://lodestone.sf.net
More information about the Discuss
mailing list