Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-21-2004, 10:01 AM   #1
LQ Newbie
Registered: Dec 2004
Location: Michigan
Distribution: Fedora Core 2
Posts: 3

Rep: Reputation: 0
Unhappy Changing Host Name in Fedora Core 2

I have a Power Edge Server running Fedora Core 2. I am trying to change the computer name, but everytime I change it and restart the changes do not hold and it goes back to the same name it had before. Can someone tell me how to find the host file and what I need to do to edit it so that the changes will remain in place.

Thanks you very much.
Old 12-21-2004, 10:31 AM   #2
LQ Newbie
Registered: Aug 2004
Distribution: Mandrake 10 (Fluxbox)
Posts: 24

Rep: Reputation: 15
I'm not sure because Im not at home today, but I think it is in /etc and it is called "hosts". However when I google changing hostname fedora core i get this:
Hi Brian,
> Yes there's an easy way of changing the hostname in FC2.
> after Login just at command line enter 'hostname' to see what is the
> hostname seted there, if returns localhost then you have to change this in
> 1. '/etc/sysconfig/network' edit this file and give hostname whatever you
> like in the line "hostname=" and then save this file and at the command line
> give the hostname command but now also you will get the same old host name
> as 'localhost' so set the hostname using command hostname (for eg: hostname
> vikas -- here hostname command will set the hostname as vikas, pls note
> that the name you are giving for the host name must be same as the hostname
> you have specified in '/etc/sysconfig/network' file.

No, it does not have to be the same. It is just that if it is different, then
what is in /etc/sysconfig/network will be the hostname when you reboot.
The hostname you set on the command line will be gone. If you are going
to reboot then messing with the hostname command is a waste of time.

At boot time the initscripts read the hostname from /etc/sysconfig/network
and set it to whatever the HOSTNAME variable is set to. Note the HOSTNAME=
line in the above file must be uppercase. ie: HOSTNAME=foo will set the
hostname to foo. hostname=foo will not.

> 2. '/etc/hosts' edit this file and this file would look like
> " IPAddress hostname localhost.localdomain localhost"
> in the place of hostname give the name as you wish(in the example same as
> hostname given in /etc/sysconfig/network file and hostname setted at command
> line), and save this file

If you have a working dns on the network and the new name resolves you do not
need to mess with /etc/hosts. If you are going to mess with /etc/hosts leave
the line with the localhost stuff in it and add another line with the new
info. That way localhost will always resolve no matter what. Not having
localhost resolve can cause problems sometimes.

> 3. Now restart the NFS and Network service by using the command 'service nfs
> restart' and
> 'service network restart'

Why? This is not necessary, especially if you are going to reboot. What is the
point of restarting a service and then rebooting the machine to restart the
service again. It appears to me you are giving advice on a subject you know
little about.

> 4. Restart your computer inorder to take effect the changes you have done.

Not necessary. Pick one way or the other. If you are going to restart the machine
simply edit /etc/sysconfig/network and /etc/hosts if necessary, then reboot.

If you do not want to reboot, then do the above plus "hostname new_hostname"
and "service syslog restart" so that syslog rereads the hostname and labels
the log files correctly. The OP wanted a simple way to change the hostname.

Your way while it will not hurt is unnecessarily complex and as you described
it above will not work (hostname= != HOSTNAME=).

Goodluck and tell us how it goes,
Old 12-21-2004, 03:25 PM   #3
LQ Newbie
Registered: Dec 2004
Location: Michigan
Distribution: Fedora Core 2
Posts: 3

Original Poster
Rep: Reputation: 0

Thanks that worked. I am really greatful.
Old 12-21-2004, 04:10 PM   #4
LQ Newbie
Registered: Aug 2004
Distribution: Mandrake 10 (Fluxbox)
Posts: 24

Rep: Reputation: 15
Sure, sure, anytime!



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
Changing screen resolution in Fedora Core 3 Stuma Linux - Newbie 3 03-26-2005 12:57 AM
changing res in fedora core 3? furtivefelon Linux - Newbie 6 02-26-2005 08:45 AM
changing mouse cursors in fedora core 3 mlu Linux - Software 4 02-26-2005 12:40 AM
Changing default login on Fedora Core 2?? strobart Fedora 8 09-03-2004 07:19 AM
Changing text resolution in Fedora Core 1 mrde50garfield Fedora 2 06-09-2004 10:26 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:58 AM.

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