LinuxQuestions.org
Review your favorite Linux distribution.
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 06-03-2013, 02:17 AM   #1
slowerogue
Member
 
Registered: Oct 2012
Posts: 96

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, 02: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, 04:03 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

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



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

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

All times are GMT -5. The time now is 02:05 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
Open Source Consulting | Domain Registration