Change hostname permanently from the Terminal without a restart

This quick tutorial explains how to change hostname permanently from the Terminal without a restart in Ubuntu 16.04.1.

Open the Terminal by keyboard shortcut Ctrl + Alt + T.

Show current hostname:
hostname

Set new static hostname:
hostnamectl set-hostname YOUR-HOSTNAME

Restart the system service that manages user logins:
systemctl restart systemd-logind.service

Check new hostname:
hostname

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Share and Enjoy
  • Facebook
  • Twitter
  • LinkedIn
  • del.icio.us
  • StumbleUpon
  • RSS
  • email
  • PDF

Published by

Samuel

Ph.D. Student in the Department of Computer and Systems Sciences, Stockholm University.

Leave a Reply

Your email address will not be published.

*