[CentOS] hostname on centos 7.1

Thu Apr 23 04:33:08 UTC 2015
Martes <mailinglistmember at mgwigglesworth.net>

Just to clarify...

I have just tested the immediate change taking effect, after reading the page listed in the other reply.

For some reason I was able to see immediate change on my vms, however, now that I try it on the Host, it does not persist.

So maybe when I was setting things up, I actually flashed the vms. (I can't remember, but the change was done, and I immediately typed `hostname` and it appeared to have taken immediate effect.  However, this is not the norm, as I have just discovered.)


Martes G Wigglesworth

----- Original Message -----
From: "Martes" <mailinglistmember at mgwigglesworth.net>
To: "centos" <centos at centos.org>
Sent: Thursday, April 23, 2015 12:28:06 AM
Subject: Re: [CentOS] hostname on centos 7.1

Greetings everyone.

I have some CentOS 7 VMs running on the system for which I just made the inquiry about the kworker problem, and I was able to institute immediate change of hostname by updating the /etc/hostname file.

I have network manager running on the host, as well, and it also has the name populated in this file.

When I make the change in /etc/hostname, it takes immediate effect, and persists across reboots, just as with /etc/sysconfig/network prior to RHEL/CentOS 7.

If my input is out of context, then I apologize for the confusion.  

(I have vlans attached to the gigabit Ethernet cable, which is used to service the exposed VMs, and I use the wireless adaptor for all other internet and lan usage, hence my use of network manager on the desktop being assumed to be relevant to this inquiry.)


Martes G Wigglesworth

----- Original Message -----
From: "Scott Robbins" <scottro at nyc.rr.com>
To: "centos" <centos at centos.org>
Sent: Tuesday, April 21, 2015 9:23:26 AM
Subject: Re: [CentOS] hostname on centos 7.1

On Tue, Apr 21, 2015 at 08:43:15AM -0400, Jerry Geis wrote:
> I have a file /etc/sysconfig/network and in the file is
> cat  /etc/sysconfig/network
> # Created by anaconda
> HOSTNAME=zotac_c7.msgnet.com
> [root at localhost ~]#
> I rebooted and the prompt is still localhost ?
> What is the new thing in CentOS 7 to set the host name
> such that then the prompt is correct also?

hostnamectl set-hostname --static c7.msgnet.com  

Without the static option, I think it leaves out the periods in the name.

Scott Robbins
PGP keyID EB3467D6
( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 )
gpg --keyserver pgp.mit.edu --recv-keys EB3467D6

CentOS mailing list
CentOS at centos.org