LinuxQuestions.org
Visit Jeremy's Blog.
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, 11: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, 11:18 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,681
Blog Entries: 14

Rep: Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022Reputation: 1022
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, 11:18 AM   #3
camorri
LQ Guru
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2
Posts: 5,118

Rep: Reputation: 494Reputation: 494Reputation: 494Reputation: 494Reputation: 494
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, 07:08 PM   #4
Doug G
Member
 
Registered: Jul 2013
Posts: 655

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, 07:28 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
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


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


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration