How to change hostname in ubuntu

1 Answer(s)

Changing the hostname or computer name in ubuntu

Edit /etc/hostname and change to the new value,

nano /etc/hostname
Edit /etc/hosts and change the old line to your new hostname localhost ubuntu.local ubuntu # change to your new hostname

Now after a reboot, your hostname will be the new one you choose.

Answered on April 24, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.