[CentOS] Prevent network setup from changing the hostname

Scott Robbins scottro at nyc.rr.com
Mon Apr 27 08:19:46 UTC 2015


On Sun, Apr 26, 2015 at 08:08:49PM -0500, Robert Nichols wrote:


> >What about this:
> >
> >hostnamectl set-hostname whateveryouwant
> 
> # which hostnamectl
> /usr/bin/which: no hostnamectl in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
> # yum provides \*/hostnamectl
>   '''
> No Matches found
> 

> Apparently does not exist for CentOS 6.

No, it's a systemd thing, I think, started with RHEL7.

I've always used /etc/sysconfig/network for the hostname entry, which works
through CentOS-6.x
-- 
Scott Robbins
PGP keyID EB3467D6
( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 )
gpg --keyserver pgp.mit.edu --recv-keys EB3467D6




More information about the CentOS mailing list