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? Thanks Jerry
Hi, Try below command then report. # hostnamectl set-hostname client.itzgeek.com If you use this command, you do not require to notify the change in host name. Close the current session and re launch the terminal. OR Directly edit /etc/hostname file and reboot. # cat /etc/hostname server.example.com --Regards Ashishkumar S. Yadav On Tue, Apr 21, 2015 at 6:13 PM, Jerry Geis <geisj at pagestation.com> 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? > > Thanks > > Jerry > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >
On 04/21/2015 07:43 AM, 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?Jerry, That only works if you use the network service and not if you use NetworkManager. How to set the host name in Network Manager: http://www.itzgeek.com/how-tos/linux/centos-how-tos/change-hostname-in-centos-7-rhel-7.html I know, you don't like it .. neither do I. It is what it is, however. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos/attachments/20150421/6291e6b1/attachment-0001.sig>
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
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.) Respectfully, 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 http://lists.centos.org/mailman/listinfo/centos