Welcome to the most active Linux Forum on the web.
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 06-25-2009, 10:33 PM   #1
LQ Newbie
Registered: Oct 2003
Location: Vic, Australia
Posts: 5

Rep: Reputation: 0
Thumbs up name change in /etc/hosts and reboot doesnt change name

hi ive changed my /etc/hosts file to a new name and when i reboot Centos 5.3 the logon splash screen still shows the old machine name. I followed the existing format of the hsots file to change the name to a new name??

is /etc/hosts the only place to change the host name?

Old 06-25-2009, 10:40 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914Reputation: 914
Nope, it's not. That's just for a mapping of names to IPs if
they're not in DNS.

To change the hostname edit /etc/sysconfig/network

Old 06-25-2009, 10:44 PM   #3
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 174
Blog Entries: 3

Rep: Reputation: 38
TO change he host name u have to follow three steps
1)put the entry in /etc/hosts
2)put the entry in /etc/sysconig/network
3)run this command hostname with giving new hostname for example: if u have new hostname like
then rum this command
Old 06-25-2009, 10:57 PM   #4
Registered: Jan 2009
Location: Canada
Distribution: CentOS 6.3, Fedora 17
Posts: 247

Rep: Reputation: 51

I'm running CentOS too, the correct place to change it is in /etc/sysconfig/network.
Old 06-25-2009, 11:09 PM   #5
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 174
Blog Entries: 3

Rep: Reputation: 38
Yes its for permanent.

For tempory perpose just run the commant
#hostname new_hostname
Old 06-26-2009, 09:40 AM   #6
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,248
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Take a look at my Blog post about Changing the Linux hostname..

how to check it, How to change it, how to do it all on the fly without need for a reboot..

props to the cpqlinux site for the info


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
fbset doesnt change anything and breaks console tommytomthms5 Linux - Newbie 2 07-12-2008 01:15 AM
script to update /etc/hosts on dhcp obtained ip change. juanctes Linux - General 1 02-02-2008 10:17 AM
updating the change of /etc/hosts.deny in AIX 4.3.3 zepplin611 AIX 7 07-18-2004 03:31 PM
cd ..' doesnt change first 5 lines on screen slackwarefan Linux - Software 2 10-21-2003 02:22 PM
Resolution doesnt change twin Linux - Newbie 4 09-25-2003 03:08 PM > Forums > Linux Forums > Linux - Newbie

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

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
Open Source Consulting | Domain Registration