LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 11-13-2006, 12:08 PM   #1
AlexAmat
LQ Newbie
 
Registered: Nov 2006
Posts: 4

Rep: Reputation: 0
How do I change the machine name on Fedora Core 6


Hi I have just installed fedora core 6 on my work machine and i need to change the machine name from aamat@v-morbison to aamat@c-aamat i have tried editing the /etc/hosts file without any luck.

Thanks in Advance
 
Old 11-13-2006, 01:17 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,147

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Try changing the HOSTNAME in /etc/sysconfig/network.

I also have an entry in /etc/hosts:
Code:
127.0.0.1       localhost.localdomain   localhost       tss-3
(The last entry in this line.)
But this is just so I can refer to my laptop as "tss-3"
 
Old 11-14-2006, 06:35 AM   #3
AlexAmat
LQ Newbie
 
Registered: Nov 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Hi thanks a lot! I have tried this and still no luck
 
Old 11-14-2006, 09:10 AM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,147

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
O.K. After a man -K hostname, I found the hostname command which should let you see and change your hostname.
 
Old 11-14-2006, 11:25 AM   #5
landonmkelsey
Member
 
Registered: Jul 2001
Location: Texas
Distribution: Fedora 16
Posts: 323

Rep: Reputation: 36
Great! but just in case keep in mind DHCP and its workings

Great! but just in case keep in mind DHCP and its workings
 
Old 11-15-2006, 05:49 AM   #6
AlexAmat
LQ Newbie
 
Registered: Nov 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Hi I have tried using the hostname command but it only changes it on a temporal basis, i need to change it so it works every time i boot the machine

Will i have to reinstall the OS in order to do that ?????? it should be a simple task

Thanks
 
Old 11-15-2006, 09:29 AM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,147

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Well, the very first thing /etc/rc.d/rc.sysinit does is a HOSTNAME=`/bin/hostname`, so an easy hack would be to add an argument there to change the hostname, or, even easier, just put your call to hostname in /etc/rc.d/rc.local.

Clearly, though, the "default" hostname is stored in some file, somewhere on your system, and it's probable that the boot process is calling hostname -f <the file>, but I just looked at the nash initrd source, and can't see the call there. Just a comment at the end that nash is finished and passing control to init, which starts a specific runlevel.

Looking at the scripts in /etc/rc.d/rc5.d/, almost all of the network related ones call /etc/sysconfig/network to set the value of HOSTNAME. That's why I thought a change there would be all you needed.

Is there, perhaps, some "shadow" copy of /etc/sysconfig/network somewhere that's overwriting your change in it when you reboot? You could see what happens if you set the "sticky" bit on for that file after you change the name in it. (Of course, that would break any process trying to modify the file, and might cause your boot process to abort.)

Another thought: you could try setting up a different profile in system-config-network with the alternate hostname, and switching the active profile(s) to change the name. I use different profiles for my laptop depending on the connection type I'm using. For example, right now I've got
Code:
$ cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=tss-3
CURRENT_PROFILE=wireless
 
Old 11-16-2006, 12:40 PM   #8
AlexAmat
LQ Newbie
 
Registered: Nov 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Hi thank you all the problem that i had was because the network at work gives an ip address and a host name every time you log into the network, all i need it to do was change my dynamic ip to an static ip

Thanks a lot
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
machine booting straight to xp after installing fedora core 5 kach Linux - Software 1 11-13-2006 06:11 AM
Access the windows machine from fedora core 2 hardeep Linux - Networking 5 06-23-2005 04:19 AM
Trying to install Fedora Core 3 on a machine that cannot boot to CD caps_phisto Fedora - Installation 1 02-11-2005 09:42 PM
Java Virtual Machine on Fedora Core 2 sonesay Fedora 3 06-06-2004 07:14 AM
Shadow passwords different on each machine (Fedora Core 1) jwolter0 Linux - Security 5 05-02-2004 05:38 AM


All times are GMT -5. The time now is 02:07 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration