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@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@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@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@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@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-cento...
I know, you don't like it .. neither do I. It is what it is, however.
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@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.
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@nyc.rr.com To: "centos" centos@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@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.
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.)
Respectfully,
Martes G Wigglesworth
----- Original Message ----- From: "Martes" mailinglistmember@mgwigglesworth.net To: "centos" centos@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.)
Respectfully,
Martes G Wigglesworth
----- Original Message ----- From: "Scott Robbins" scottro@nyc.rr.com To: "centos" centos@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@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.