Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 23rd November 2011, 04:55 PM
PiElle Offline
Registered User
 
Join Date: Jun 2011
Location: Italy
Posts: 283
linuxfirefox
change host name in Fedora16

To change the computer name in F16 is sufficient to edit:
1) /etc/sysconfig/network;
2) /etc/hosts?
It's correct to add the new hostname to the /etc/hosts file, leaving the localhost name in there as well?
Do I have to edit other files to avoid problems?
Reply With Quote
  #2  
Old 23rd November 2011, 05:07 PM
sea's Avatar
sea Online
"Shells" (of a sub world)
 
Join Date: May 2011
Location: Helvetic Federation (Swissh)
Age: 33
Posts: 2,606
linuxfirefox
Re: change host name in Fedora16

afaik, you may simply change the first line of /etc/hosts:
Quote:
Originally Posted by orginal
127.0.0.1 localhost.localdomain localhost
to
Quote:
Originally Posted by changed
127.0.0.1 localhost.localdomain NEWNAME
Hope this helps
__________________
Fedora Manual: http://docs.fedoraproject.org
Script-Tools: https://sourceforge.net/projects/script-tools/
sudo st tweak repo toggle fedora-rawhide ; st iso dl-fed -respin && st iso usb

Last edited by sea; 23rd November 2011 at 05:10 PM. Reason: typo
Reply With Quote
  #3  
Old 23rd November 2011, 05:11 PM
PabloTwo's Avatar
PabloTwo Online
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: change host name in Fedora16

There is a command for that. It's called hostname.
Quote:
hostname - show or set the system’s host name
Reply With Quote
  #4  
Old 23rd November 2011, 05:23 PM
DBelton's Avatar
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 6,612
linuxfirefox
Re: change host name in Fedora16

Quote:
afaik, you may simply change the first line of /etc/hosts:
Quote:
Originally Posted by orginal
127.0.0.1 localhost.localdomain localhost
to
Quote:
Originally Posted by changed
127.0.0.1 localhost.localdomain NEWNAME
Hope this helps
You really don't want to replace the localhost name with NEWNAME as you showed, sea..

What you would want is more like this:
Code:
127.0.0.1 localhost.localdomain localhost NEWNAME
Reply With Quote
  #5  
Old 23rd November 2011, 05:32 PM
PiElle Offline
Registered User
 
Join Date: Jun 2011
Location: Italy
Posts: 283
linuxfirefox
Re: change host name in Fedora16

I set my /etc/hosts file as follows ... (where pc2 is the NEW computer's name)
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 pc2
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 pc2
Reply With Quote
  #6  
Old 24th November 2011, 04:27 AM
DBelton's Avatar
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 6,612
linuxfirefox
Re: change host name in Fedora16

that is the correct way to put the new hostname in your /etc/hosts file.

You always want to keep the localhost and localhost.localdomain in there as there are applications that depend on that name being in there.

as far as the actual changing of the hostname, I would do as PabloTwo suggested above and use the hostname to change it. You can manually edit the /etc/sysconfig/network file, and it should be enough, but to be safe, I would use the hostname command
Reply With Quote
  #7  
Old 24th November 2011, 07:54 AM
PiElle Offline
Registered User
 
Join Date: Jun 2011
Location: Italy
Posts: 283
linuxfirefox
Re: change host name in Fedora16

I edited manually the /etc/sysconfig/network file, changing the previous name in the "HOSTNAME=pc_name" string (this is valid for other Linux distributions too).

But, to say the truth, I've noticed that in a (absolutely) fresh installation of F16 the /etc/hosts file is like this:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

I mean: it doesn't contain the computer name! In this case, the computer had been named pc during the installation process ...

Last edited by PiElle; 24th November 2011 at 08:01 AM.
Reply With Quote
  #8  
Old 25th November 2011, 08:12 AM
salemhouda Offline
Registered User
 
Join Date: Nov 2011
Posts: 4
linuxchrome
Re: change host name in Fedora16

Edit this file /etc/hostname
Reply With Quote
  #9  
Old 14th April 2012, 09:47 PM
starmagus Offline
Registered User
 
Join Date: Aug 2011
Location: Mexico
Posts: 1
linuxfirefox
Re: change host name in Fedora16

Hi Salem,

In Fedora 16, that file doesn't exist.

You can use hostname command to set a temporary hostname, until the next reboot.

A permanent change needs to made in the /etc/sysconfig/network file as mentioned above.
Reply With Quote
Reply

Tags
change, fedora16, host

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change computer name or host name? jhedrotten Using Fedora 5 30th December 2008 01:25 AM
Change Host Name Question htnusa Servers & Networking 3 31st July 2008 07:56 PM
remote change host.allow lazlow Using Fedora 1 1st March 2007 01:00 AM
Change de host name lgoulartsilva Using Fedora 13 7th August 2006 09:43 PM


Current GMT-time: 21:58 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat