View Full Version : change computer name..

17th July 2006, 05:27 PM
Can some one tell me how to I automate computer name on Fedora core 2.. I have more than 3 PCs, when i reimage the PC, all three have the same name, so I want it to automatically generate computer name when reimaging.


17th July 2006, 09:53 PM
Interesting, I wonder if you could use a variable and have the MAC address be part of the computer name, or something to that effect. you could also have a server system that hosts the image, and use like a pxe boot/ris or whatever the linux equiv is, im not sure exactly, I have doen this with a RIS server, on my 2k3 box which now runs FC5

18th July 2006, 02:26 AM
We can use this using sysprep on xp but i dont know how to do it in linux.

Thanks in advance.

18th July 2006, 02:35 AM
When prompt for username and password to logon to Fedora, the default is "localhost.localdomain", i would like it to automaticallly create a name.

I have dual boot OS ( XP & FC2), I have sysprep XP it can do automatic naming concention, but not FC2, its only give me the default "localhost.localdomain".

18th July 2006, 02:48 AM
when doing your install you have the option to set the host name

18th July 2006, 02:50 AM
true, but I have a large number of PCs. I dont want to change it manually every time I re-image the machines.

Any other ways?

18th July 2006, 02:58 AM
man hostname

18th July 2006, 03:59 AM
When you say more then 3....do you mean, like 4?

18th July 2006, 04:17 AM
i have 70 PCs, do it manually going to kill me.

18th July 2006, 04:44 AM
Is there a way to set the MAC address as a host name or something. Im a novice user in linux.


18th July 2006, 04:53 AM
you would need to write some kind of bash script (bash = command line shell) that

a.) does an ifconfig /all and parses the mac address as a variable. The linux commands that parse CLI output include SED and AWK. I'm no expert so I won't be able to tlel you exactly how but it would be like saying "take output of x command, and put the value 13 characters across into variable y".

b.) set hostname as variable y

c.) profit

My scripting skillz are rather lacking so you'll have to learn yourself or wait for someone to do the hard work for you

18th July 2006, 05:01 AM
c.) profit

LOL hahaahah BBQ sause (http://en.wikipedia.org/wiki/Underpants_Gnomes)