LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 06-03-2013, 03:17 AM   #1
slowerogue
Member
 
Registered: Oct 2012
Posts: 93

Rep: Reputation: Disabled
hostname issue, cant change it properly


i have two machine, both are same version rhel6.4

serverB, installed the server by default hostname, localhost.localdomain

hostname -s
localhost

hostname
localhost.localdomain

can i change the hostname without edit /etc/sysconfig/network


because my serverA, i change the hostname during installation.
/etc/sysconfig/network is showing hostname=localhost.localdomain, but when i type hostname, it shows serverA
 
Old 06-03-2013, 03:41 AM   #2
Rohit_4739
Member
 
Registered: Oct 2010
Distribution: Red Hat
Posts: 228

Rep: Reputation: 9
Yes you can change the hostname without editing the /etc/sysconfig/network file, but it will not persist a system reboot. For example

Code:
serv1#hostname server1
Would change the hostname from serv1 to server1 but after the system reboot it would revert back to serv1 if hostname specified in /etc/sysconfig/network is serv1.
 
Old 06-03-2013, 05:03 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
You can put it in /etc/sysconfig/network
Code:
NETWORKING=yes
HOSTNAME=boole
You may also want to put the FQDN and IP in /etc/hosts if you haven't got DNS
Code:
# HW eth0
192.168.1.100	boole.hw.net.local boole
 
  


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
'hostname some_name' does not change the hostname. stf92 Slackware 11 02-21-2013 08:09 PM
Hostname issue - showing "localhost" instead of actual hostname. ryes31 Linux - Server 9 12-12-2012 09:19 PM
getting errors related to hostname -- security problem? ok to change hostname? sneakyimp Linux - Server 2 11-18-2012 06:25 PM
after hostname change, syslogd still output previous hostname to messages file tiger2000 Linux - General 3 07-22-2009 10:36 PM
change hostname mikpos Linux - Networking 1 08-12-2004 01:19 PM


All times are GMT -5. The time now is 12:46 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration