LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-13-2015, 10:10 AM   #1
ammarzaheer
LQ Newbie
 
Registered: Oct 2015
Location: Saudia Arabia
Posts: 1

Rep: Reputation: Disabled
How to permanently change Host-name in Linux ??


i am new to linux and want to change the host name when i do it with
host name new-name , it doesn't change permanently.
Can any one help me in this ??

My linux version as below

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:37:40 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
 
Old 10-13-2015, 10:18 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
That tells you kernel version but not Linux distro. However, your kernel ending in uek suggests Oracle's Unbreakable Linux (uek = unbreakable enterprise kernel). You can cat /etc/issue or other files in /etc to determine Linux distro.

Anyway Oracle's Linux was derived from RedHat Enterprise Linux (RHEL) so you can probably change it by editing /etc/sysconfig/network to change the hostname there. Also don't forget to update your /etc/hosts file to show the new name.

If you do a reboot after changing these the next boot should have the new hostname.
 
1 members found this post helpful.
Old 10-13-2015, 10:18 AM   #3
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,214

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
See this link. It describes both temporary and permanent changes to hostname.

-->http://www.ducea.com/2006/08/07/how-...-linux-system/
 
Old 10-13-2015, 06:08 PM   #4
Doug G
Member
 
Registered: Jul 2013
Posts: 749

Rep: Reputation: Disabled
If you have Fedora/Centos the command line hostnamectl program makes it easy to manage the host name
 
Old 10-13-2015, 06:28 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by Doug G View Post
If you have Fedora/Centos the command line hostnamectl program makes it easy to manage the host name
Keep in mind that hostnamectl is a systemd command, so it is not present in CentOS/RHEL versions older than 7.
 
  


Reply



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
LXer: How to change USB device permission permanently on Linux LXer Syndicated Linux News 0 09-17-2015 12:03 AM
[SOLVED] How to change host name permanently in CentOS 6.2 ? rohitkanojia Linux - Newbie 3 05-14-2012 12:17 AM
[SOLVED] how to change permanently a script in etc joham34 Linux - Newbie 6 04-29-2010 07:52 AM
Can't permanently change path SuperRunt Linux - Newbie 11 02-02-2005 11:59 PM
can't change tcp_sack permanently kentri9 Linux - Networking 1 10-30-2004 05:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:45 PM.

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