LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] changing hostid in linux 7.2

[ILUG] changing hostid in linux 7.2

Daniel Shaw dshaw78 at gmail.com
Wed Dec 13 23:02:02 GMT 2006


> > reformatting the drive changed the hostid to 7f0100.
> >
> > Is there anyway I can change the hostid in 7.2?

You mean Red Hat 7.2 (I'm guessing). Linux is only up to version 2.6.x
these days. Version 7 is a ways off still ;-).

Anyhoo..

> Sure, why not. Assuming you mean the hostname that is :
>
> Edit /etc/sysconfig/network
> Change the hostname in there

Not quite my friend. hostname != hostid. However, as tonight is the
first time I've heard of hostid and it's man page is rather sparse I
did a little google:


hostid

    Echo a 32-bit hexadecimal numerical identifier for the host machine.

    bash$ hostid
    7f0100

    Note	

    This command allegedly fetches a "unique" serial number for a
particular system. Certain product registration procedures use this
number to brand a particular user license. Unfortunately, hostid only
returns the machine network address in hexadecimal, with pairs of
bytes transposed.

    The network address of a typical non-networked Linux machine, is
found in /etc/hosts.

    bash$ cat /etc/hosts
    127.0.0.1               localhost.localdomain localhost

    As it happens, transposing the bytes of 127.0.0.1, we get
0.127.1.0, which translates in hex to 007f0100, the exact equivalent
of what hostid returns, above. There exist only a few million other
Linux machines with this identical hostid.

>
> In addition, you should change the name in /etc/hosts

So yes, this is the part you need to edit. The example above from the
we is a little misleading though, becasue you only get 7f0100 if the
hostname name is mapped to 127.0.0.1 in /etc/hosts (where they just
have localhost).

On this laptop:

# hostname
ziggy

grep ziggy /etc/hosts
10.78.9.15  ziggy

# hostid
4e0a0f09


But if I make a change so..

# grep ziggy /etc/hosts
127.0.0.1 localhost.localdomain localhost ziggy
10.78.9.15  ziggy

then...

# hostid
7f0100

(No rebooting need. Conor, dude, you should know better than that. You
never have to reboot) ;-)

> Dead easy my friend, dead easy.

With google it is!

Cheers,
Daniel



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell