How do I change the hostname without a restart?

How do I change the hostname without a restart?

Without restart:

Update new hostname
sudo vim /etc/hostname

also update sudo vim /etc/hosts accordingly

sudo sysctl kernel.hostname=mynewlocalhost

When done check your current hostname with hostname -f

Share: Share on Twitter Share on Facebook Share on LinkedIn Reddit
Continue Reading

Comments are provided by Disqus and load only when requested.

The Mailchimp signup integration loads only when requested.